Browse Source

base script

Brandon Wong 8 years ago
commit
c32e52511b
1 changed files with 60 additions and 0 deletions
  1. 60 0
      maker.sh

+ 60 - 0
maker.sh

@@ -0,0 +1,60 @@
+#!/bin/bash
+
+foldername=$1
+
+if [[ -z $foldername ]]
+then
+    echo "need a folder name"
+else
+
+    #mkdir $foldername
+    git init $foldername
+    cd $foldername
+    mkdir src test
+
+cat >package.json <<EOL
+{
+  "name": "$foldername",
+  "version": "0.1.0",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1",
+    "postinstall": "npm run compile",
+    "compile-test": "babel test --out-dir test-build",
+    "compile-src": "babel src --out-dir build",
+    "compile": "npm run compile-src; npm run compile-test",
+    "watch": "nodemon --watch src --watch test --exec \"npm run compile --silent\"",
+    "serverwatch": "nodemon --watch src --watch test --exec \"npm run compile --silent && node build/server.js\"",
+    "testwatch": "nodemon --watch src --watch test --exec \"npm run compile --silent && npm test\""
+  },
+  "dependencies": {
+    "babel-cli": "^6.6.5",
+    "babel-preset-es2015": "^6.6.0"
+  },
+  "devDependencies": {
+    "blue-tape": "^0.2.0",
+    "nodemon": "^1.9.1",
+    "tape": "^4.5.1"
+  },
+  "private": true
+}
+EOL
+
+cat >.babelrc <<EOL
+{
+  "presets": ["es2015"]
+}
+EOL
+
+cat >.gitignore <<EOL
+.idea
+node_modules
+build
+test-build
+npm-debug*
+*.swp
+EOL
+
+
+    echo "done."
+
+fi