Skip to content

Commit

Permalink
fixed npm installer env issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
acunniffe committed Oct 31, 2018
1 parent fc8b456 commit 83dbb4c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
1 change: 1 addition & 0 deletions cli/.npmignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.optic-storage/
src/
11 changes: 6 additions & 5 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "optic-cli",
"version": "2.0.0rc3",
"version": "2.0.5",
"description": "",
"main": "./lib/Cli.js",
"main": "lib/Cli.js",
"scripts": {
"build": "rm -rf ./lib && babel src --out-dir lib",
"build-server": "cd ../ && sh ./build.sh",
Expand Down Expand Up @@ -64,9 +64,10 @@
},
"files": [
"jars/server-assembly.jar",
"resources/Smoketest.class",
"resources/Smoketest.java",
"react-diff-view/*"
"resources/*",
"lib",
"react-diff-view/*",
"features.json"
],
"jreConfig": {
"major_version": "8",
Expand Down
4 changes: 3 additions & 1 deletion cli/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ export default (() => {
} else {
const appRootPath = require('app-root-path').toString()

const path = [(appRootPath.endsWith('/lib')) ? '../jars/server-assembly.jar' : 'jars/server-assembly.jar']

return {
runServerCmd: {
binary: driver,
options: ['-jar', `${appRootPath}/jars/server-assembly.jar`]
options: ['-jar', `${appRootPath}/${path}`]
},
storageDirectory: require('os').homedir()+'/.optic-storage',
projectDirectory: process.cwd()
Expand Down
13 changes: 10 additions & 3 deletions cli/src/jre/jre-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
const request = require('request');
const ProgressBar = require('progress');
const child_process = require('child_process');
const isDev = require('../config').isDev

const appRootPath = require('app-root-path')

Expand Down Expand Up @@ -78,9 +79,15 @@
(classpath, classname, args, options) =>
child_process.spawnSync(driver(), getArgs(classpath, classname, args), options);

const smoketest = exports.smoketest = () =>
spawnSync(['resources'], 'Smoketest', [], { encoding: 'utf8', cwd: appRootPath.toString() })
.stdout.trim() === 'No smoke!';
const smoketest = exports.smoketest = () => {
const cwd = appRootPath.toString()

const path = [(cwd.endsWith('/lib')) ? '../resources' : 'resources']

return spawnSync(path, 'Smoketest', [], {encoding: 'utf8', cwd})
.stdout.trim() === 'No smoke!';

}

const url = exports.url = () =>
'https://download.oracle.com/otn-pub/java/jdk/' +
Expand Down

0 comments on commit 83dbb4c

Please sign in to comment.