Skip to content

Commit 9809230

Browse files
authored
Merge pull request #199 from smalruby/crossplatform_setup_opal
crossplatformalize setup-opal scripts.
2 parents 1536185 + 0f5c851 commit 9809230

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

package-lock.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "GraphicaL User Interface for creating and running Smalruby 3.0 projects",
55
"main": "./dist/smalruby3-gui.js",
66
"scripts": {
7-
"setup-opal": "if [ ! -e ./static/javascripts/setup-opal.js ]; then mkdir -p ./static/javascripts && (cd opal && cat opal.min.js config-opal.js opal-parser.min.js config-opal-parser.js > ../static/javascripts/setup-opal.js); fi",
7+
"setup-opal": "node ./scripts/make-setup-opal.js",
88
"build": "npm run clean && npm run setup-opal && webpack --progress --colors --bail",
99
"clean": "rimraf ./static/javascripts/setup-opal.js && rimraf ./build && mkdirp build && rimraf ./dist && mkdirp dist",
1010
"deploy": "touch build/.nojekyll && gh-pages -t -d build -m \"Build for $(git log --pretty=format:%H -n1)\"",
@@ -119,6 +119,7 @@
119119
"scratch-svg-renderer": "0.2.0-prerelease.20190822202608",
120120
"scratch-vm": "0.2.0-prerelease.20190918022946",
121121
"selenium-webdriver": "3.6.0",
122+
"shelljs": "^0.8.3",
122123
"startaudiocontext": "1.2.1",
123124
"style-loader": "^0.23.0",
124125
"svg-to-image": "1.1.3",

scripts/make-setup-opal.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
var shell = require('shelljs');
2+
var fs = require('fs');
3+
4+
if (!fs.existsSync('./static/javascripts/setup-opal.js')) {
5+
shell.mkdir('-p', './static/javascripts');
6+
shell.cd('opal');
7+
var s = shell.cat('opal.min.js', 'config-opal.js', 'opal-parser.min.js', 'config-opal-parser.js');
8+
shell.cd('..');
9+
fs.writeFileSync('./static/javascripts/setup-opal.js', s);
10+
}

0 commit comments

Comments
 (0)