-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2d19210
commit ad66d97
Showing
7 changed files
with
115 additions
and
1,346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,4 +75,4 @@ integration-test/transform-tests/output | |
|
||
# generated Sphinx/ReadTheDocs files | ||
/docs/build/ | ||
/foo | ||
/demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import parseArgs from 'minimist'; | ||
import chalk from 'chalk'; | ||
import { spawn } from 'child_process'; | ||
import { promises as fs } from 'fs'; | ||
import { resolve } from 'any-promise'; | ||
|
||
export default async function installMain(progname, rawArgs, priv) { | ||
const { console, error } = priv; | ||
const { | ||
_: args, | ||
} = parseArgs(rawArgs); | ||
|
||
let uiPackager = 'npm'; | ||
try { | ||
await fs.stat('ui/yarn.lock'); | ||
uiPackager = 'yarn'; | ||
} catch (e) {} | ||
|
||
const pspawn = (...args) => new Promise((resolve, reject) => { | ||
const cp = spawn(...args); | ||
cp.on('exit', resolve); | ||
cp.on('error', () => resolve(-1)); | ||
}); | ||
const ret = await pspawn('nogo', ['version']); | ||
|
||
const goCmd = ret === 0 && pspawn('npm', ['install'], { cwd: '.agservers', stdio: 'inherit' }); | ||
|
||
const children = await Promise.all([ | ||
pspawn(uiPackager, ['install'], { cwd: 'ui', stdio: 'inherit' }), | ||
pspawn('npm', ['install'], { cwd: 'api', stdio: 'inherit' }), | ||
pspawn('npm', ['install'], { cwd: 'contract', stdio: 'inherit' }), | ||
goCmd, | ||
]); | ||
|
||
if (!goCmd) { | ||
console.log(chalk.bold.yellow(`To run Agoric locally you will need to install Go and rerun '${progname} install'`)); | ||
} | ||
console.log(chalk.bold.green('Done installing')); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.