diff --git a/bin/create-elm-app-cli.js b/bin/create-elm-app-cli.js index ed4592c3..c698190f 100755 --- a/bin/create-elm-app-cli.js +++ b/bin/create-elm-app-cli.js @@ -6,7 +6,7 @@ const path = require('path'); const spawn = require('cross-spawn'); const argv = require('minimist')(process.argv.slice(2)); const version = require('../package.json').version; -const elmPlatformVersion = require('elm/package.json').version; +const elmVersion = require('elm/package.json').version; const commands = argv._; if (commands.length === 0) { @@ -14,7 +14,7 @@ if (commands.length === 0) { console.log( 'where is the name of the directory with your future project' ); - console.log('\nElm Platform ' + elmPlatformVersion + '\n'); + console.log('\nElm Platform ' + elmVersion + '\n'); console.log( 'create-elm-app@' + version + ' ' + path.resolve(__dirname, '..') ); diff --git a/bin/elm-app-cli.js b/bin/elm-app-cli.js index 0356dabf..400c7064 100755 --- a/bin/elm-app-cli.js +++ b/bin/elm-app-cli.js @@ -5,9 +5,9 @@ const path = require('path'); const spawn = require('cross-spawn'); const argv = require('minimist')(process.argv.slice(2)); -const executablePaths = require('elm/platform').executablePaths; +const elmExecutable = path.resolve(__dirname, '../node_modules/.bin/elm') const version = require('../package.json').version; -const elmPlatformVersion = require('elm/package.json').version; +const elmVersion = require('elm/package.json').version; const commands = argv._; @@ -37,7 +37,7 @@ switch (script) { args = args.concat([ '--compiler', - path.normalize(executablePaths['elm-make']) + elmExecutable ]); const cp = spawn.sync(require.resolve('elm-test/bin/elm-test'), args, { @@ -51,18 +51,15 @@ switch (script) { break; } case 'install': { - const executable = executablePaths['elm-package']; - spawn.sync(path.normalize(executable), process.argv.slice(2), { + spawn.sync(elmExecutable, process.argv.slice(2), { stdio: 'inherit' }); break; } default: // Proxy elm-platform cli commands. - if (['package', 'reactor', 'make', 'repl'].indexOf(script) !== -1) { - const executable = executablePaths['elm-' + script]; - - spawn.sync(path.normalize(executable), process.argv.slice(3), { + if (['reactor', 'make', 'repl'].indexOf(script) !== -1) { + spawn.sync(elmExecutable, process.argv.slice(2), { stdio: 'inherit' }); break; @@ -84,7 +81,7 @@ function help(version) { console.log( ' create, build, start, install, test, eject, package, reactor, make, repl\n' ); - console.log('\nElm ' + elmPlatformVersion + '\n'); + console.log('\nElm ' + elmVersion + '\n'); console.log( 'create-elm-app@' + version + ' ' + path.resolve(__dirname, '..') ); diff --git a/config/paths.js b/config/paths.js index 19f14173..4fb4a412 100644 --- a/config/paths.js +++ b/config/paths.js @@ -47,7 +47,7 @@ module.exports = { entry: resolveApp('./src/index.js'), appBuild: resolveApp('./build'), elmJson: resolveApp('./elm.json'), - elm: require('elm/platform').executablePaths['elm'], + elm: path.resolve(__dirname, '../node_modules/.bin/elm'), publicUrl: getPublicUrl(resolveApp('elm.json')), servedPath: getServedPath(resolveApp('elm.json')) }; diff --git a/scripts/create.js b/scripts/create.js index 28891763..47a23324 100644 --- a/scripts/create.js +++ b/scripts/create.js @@ -7,7 +7,6 @@ const chalk = require('chalk'); const spawnSync = require('child_process').spawnSync; const argv = require('minimist')(process.argv.slice(2)); const commands = argv._; -const executablePaths = require('elm/platform').executablePaths; if (commands.length === 0 || commands[0] === '') { console.error('\nUsage: elm-app create '); @@ -40,10 +39,10 @@ function createElmApp(name) { process.chdir(root); - // Run initial `elm-package install -y` + // Run initial `elm make` const spawnElmPkgResult = spawnSync( - executablePaths['elm-package'], - ['install', '-y'], + path.resolve(__dirname, '../node_modules/.bin/elm'), + ['make', 'src/Main.elm'], { stdio: 'inherit' } );