Fix run first time

Now called `only-once`
but will not throw if run more than once
also, uses node to create file
This commit is contained in:
Berkeley Martinez
2015-12-07 23:15:50 -08:00
parent c23367f62b
commit e12e49e25e
2 changed files with 3 additions and 3 deletions

View File

@ -119,7 +119,7 @@ mongod
# Initialize Free Code Camp
# This will seed the database for the first time.
# This command should only be run once.
npm run first-time
npm run only-once
# start the application
gulp

View File

@ -6,8 +6,8 @@
"url": "https://github.com/freecodecamp/freecodecamp.git"
},
"scripts": {
"first-time": "npm run create-rev && echo '\n\nseeding database\n\n' && node seed && node seed/nonprofits",
"create-rev": "test ! -e server/rev-manifest.json && echo '\n\ncreating manifest\n\n' && touch server/rev-manifest.json && echo '{}' >> server/rev-manifest.json",
"only-once": "npm run create-rev && echo '\n\nseeding database\n\n' && node seed && node seed/nonprofits && ech",
"create-rev": "node -e \"console.log('\\n\\ncreating manifest\\n\\n'); require('fs').writeFileSync('server/rev-manifest.json', '{}');\"",
"build": "NODE_ENV=production gulp build -p",
"start": "babel-node server/server.js",
"prestart-production": "bower cache clean && bower install && gulp build -p",