mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 01:47:39 -07:00
いい感じに
This commit is contained in:
parent
1188142308
commit
df77a546b6
1 changed files with 4 additions and 2 deletions
|
@ -1,6 +1,8 @@
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
const yaml = require('js-yaml');
|
const yaml = require('js-yaml');
|
||||||
const inquirer = require('inquirer');
|
const inquirer = require('inquirer');
|
||||||
|
const chalk = require('chalk');
|
||||||
|
|
||||||
const configDirPath = `${__dirname}/../.config`;
|
const configDirPath = `${__dirname}/../.config`;
|
||||||
const configPath = `${configDirPath}/default.yml`;
|
const configPath = `${configDirPath}/default.yml`;
|
||||||
|
@ -170,12 +172,12 @@ inquirer.prompt(form).then(as => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log(`Thanks. Writing the configuration to ${configPath}`);
|
console.log(`Thanks. Writing the configuration to ${chalk.bold(path.resolve(configPath))}`);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fs.mkdirSync(configDirPath);
|
fs.mkdirSync(configDirPath);
|
||||||
fs.writeFileSync(configPath, yaml.dump(conf));
|
fs.writeFileSync(configPath, yaml.dump(conf));
|
||||||
console.log('Well done.');
|
console.log(chalk.green('Well done.'));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue