Skip to content

Commit 4b3ec6a

Browse files
committed
chore: clean up commented code
1 parent 2ce3069 commit 4b3ec6a

File tree

2 files changed

+0
-66
lines changed

2 files changed

+0
-66
lines changed

cli.js

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ const {
1717
copyDirSync,
1818
copyDirToSync,
1919
render,
20-
// getGhPagesBaseUrl,
2120
validateDefinitionFileName,
2221
readYaml
23-
// getCurrentGitHubRepo
2422
} = require('./lib/utils');
2523

2624
const { installDeps } = require('./lib/install-deps');
@@ -68,48 +66,15 @@ async function ask(openapiRoot, docsRoot) {
6866
validate: i => (i.length > 0 ? true : `API Name can't be empty`)
6967
});
7068

71-
// const { splitSpec } = await prompt({
72-
// type: 'confirm',
73-
// name: 'splitSpec',
74-
// message: `Split spec into separate files: paths/*, definitions/* ${chalk.yellow(
75-
// '[Experimental]'
76-
// )}?`,
77-
// default: true
78-
// });
79-
8069
const { codeSamples } = await prompt({
8170
type: 'confirm',
8271
name: 'codeSamples',
8372
message: `Prepare manual code samples folder?`,
8473
default: true
8574
});
8675

87-
// const { swaggerUI } = await prompt({
88-
// type: 'confirm',
89-
// name: 'swaggerUI',
90-
// message: `Install SwaggerUI?`,
91-
// default: false
92-
// });
93-
94-
// const { travis } = await prompt({
95-
// type: 'confirm',
96-
// name: 'travis',
97-
// message: `Set up Travis CI?`,
98-
// default: true
99-
// });
10076

10177
let repo;
102-
// if (travis) {
103-
// repo = (await prompt({
104-
// type: 'input',
105-
// name: 'repo',
106-
// message: `Specify name of GitHub repo in format ${chalk.blue('User/Repo')}:`,
107-
// default: getCurrentGitHubRepo,
108-
// validate: function(input) {
109-
// return input.indexOf('/') > 0 ? true : 'Repo Name must contain "/"';
110-
// }
111-
// })).repo;
112-
// }
11378

11479
const { proceed } = await prompt({
11580
type: 'confirm',
@@ -127,10 +92,7 @@ async function ask(openapiRoot, docsRoot) {
12792
return {
12893
definitionFileName,
12994
apiTitle,
130-
// splitSpec,
13195
codeSamples,
132-
// swaggerUI,
133-
// travis,
13496
repo,
13597
proceed
13698
};
@@ -205,7 +167,6 @@ Choose another directory or remove contents.
205167
const data = {
206168
...opts,
207169
packageName: slugify(opts.apiTitle).toLowerCase()
208-
// ghPagesBaseUrl: opts.repo ? getGhPagesBaseUrl(opts.repo) : undefined
209170
};
210171

211172
let { definitionFileName } = opts;
@@ -230,10 +191,6 @@ Choose another directory or remove contents.
230191
copyDirSync('openapi/code_samples', openapiRoot);
231192
}
232193

233-
// if (opts.travis) {
234-
// await copy('.travis.yml');
235-
// }
236-
237194
copyDirToSync('docs', docsRoot);
238195

239196
splitDefinition(readYaml(definitionFileName), openapiRoot);

lib/utils.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
const fs = require('fs');
22
const path = require('path');
3-
// const { execSync } = require('child_process');
43

54
const ejs = require('ejs');
6-
// const gitUrlParse = require('git-url-parse');
75
const chalk = require('chalk');
86
const yaml = require('js-yaml');
97
const mkdirp = require('mkdirp');
@@ -55,17 +53,6 @@ exports.validateDefinitionFileName = fileName => {
5553
return true;
5654
};
5755

58-
// exports.getCurrentGitHubRepo = () => {
59-
// try {
60-
// const remoteUrl = execSync('git config --get remote.origin.url').toString();
61-
// const parsedUrl = gitUrlParse(remoteUrl.trim());
62-
// if (parsedUrl.owner && parsedUrl.name) {
63-
// return parsedUrl.owner + '/' + parsedUrl.name;
64-
// }
65-
// } catch (e) {}
66-
// return undefined;
67-
// };
68-
6956
exports.copy = async (file, openAPIDir) => {
7057
const { src, target } = provisionPaths(file, openAPIDir);
7158
mkdirp.sync(path.dirname(target));
@@ -92,16 +79,6 @@ exports.render = async (file, data, openAPIDir) => {
9279
fs.writeFileSync(target, res);
9380
};
9481

95-
// exports.getGhPagesBaseUrl = repo => {
96-
// const [user, name] = repo.split('/');
97-
// // TODO: support CNAME
98-
// let url = user.toLowerCase() + '.github.io';
99-
// if (name !== url) {
100-
// url += '/' + name;
101-
// }
102-
// return 'https://' + url + '/';
103-
// };
104-
10582
function copyDirSync(srcDir, targetDir) {
10683
const list = fs.readdirSync(srcDir);
10784
list.forEach(file => {

0 commit comments

Comments
 (0)