Browse Source

Less escaping, direct constants in npm scripts.

Herbert Vojčík 8 years ago
parent
commit
e165ee41dc
1 changed files with 6 additions and 2 deletions
  1. 6 2
      package.json

+ 6 - 2
package.json

@@ -23,10 +23,14 @@
   "engines": {
     "node": "0.10.x || 0.12.x || >=4.0.0"
   },
+  "strings": {
+    "buildParserBegin": "define(['./boot'], function($boot) {\nvar $globals = $boot.globals, nil = $boot.nil;\n",
+    "buildParserEnd": "});"
+  },
   "scripts": {
-    "build:parser:begin": "node -e \"process.stdout.write('define([\\'./boot\\'], function($boot) {\\nvar $globals = $boot.globals, nil = $boot.nil;\\n');\"",
+    "build:parser:begin": "node -e \"process.stdout.write(require('./package.json').strings.buildParserBegin);\"",
     "build:parser": "(npm run -s build:parser:begin && pegjs --cache --export-var $globals.SmalltalkParser < support/parser.pegjs && npm run -s build:parser:end) > support/parser.js",
-    "build:parser:end": "node -e \"process.stdout.write('});');\"",
+    "build:parser:end": "node -e \"process.stdout.write(require('./package.json').strings.buildParserEnd);\"",
     "test": "npm run test:sunit && npm run test:e2e",
     "test:sunit": "grunt test",
     "test:e2e": "(cd external && cd amber-cli && npm test)"