Last active
August 4, 2019 00:41
-
-
Save wjx0820/418b70c4d208ebd6339986ac08cd19bf to your computer and use it in GitHub Desktop.
mkdir命令行工具
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const argv = require('minimist')(process.argv.slice(2)); | |
const fse = require('fs-extra'); | |
const { p, s } = argv; | |
if (!p|| !s) { | |
console.info('-p: problem number'); | |
console.info('-s: solution name'); | |
console.error('Please enter problem number and solution name.'); | |
process.exit(-1); | |
} | |
const srcDir = `./src/problem${p}/${s}.js`; | |
const testDir = `./test/problem${p}/${s}.test.js`; | |
fse.ensureFileSync(srcDir); | |
fse.ensureFileSync(testDir); | |
console.info('Done!'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment