不要怂,就是干,撸起袖子干!

Commit fd2bcfbd by Sascha Depold

made version dynamic

1 parent dda90fc5
Showing with 5 additions and 3 deletions
...@@ -9,9 +9,11 @@ const path = require("path") ...@@ -9,9 +9,11 @@ const path = require("path")
var configPath = process.cwd() + '/config' var configPath = process.cwd() + '/config'
, migrationsPath = process.cwd() + '/migrations' , migrationsPath = process.cwd() + '/migrations'
, packageJsonPath = __dirname + '/../package.json'
, packageJson = JSON.parse(fs.readFileSync(packageJsonPath).toString())
, configFile = configPath + '/config.json' , configFile = configPath + '/config.json'
, configPathExists = path.existsSync(configPath) , configPathExists = fs.existsSync(configPath)
, configFileExists = path.existsSync(configFile) , configFileExists = fs.existsSync(configFile)
var writeConfig = function(config) { var writeConfig = function(config) {
!configPathExists && fs.mkdirSync(configPath) !configPathExists && fs.mkdirSync(configPath)
...@@ -56,7 +58,7 @@ var readConfig = function() { ...@@ -56,7 +58,7 @@ var readConfig = function() {
} }
program program
.version('1.3.0') .version(packageJson.version)
.option('-i, --init', 'Initializes the project. Creates a config/config.json') .option('-i, --init', 'Initializes the project. Creates a config/config.json')
.option('-m, --migrate', 'Runs undone migrations') .option('-m, --migrate', 'Runs undone migrations')
.option('-u, --undo', 'Redo the last migration.') .option('-u, --undo', 'Redo the last migration.')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!