Skip to content

Commit

Permalink
feat(commands/run): introduce --client-version
Browse files Browse the repository at this point in the history
This commit introduces a new option `--client-version` that can be used to
specify the Aragon client version to be used as discussed in aragon#182. A version
can be any commit-ish values (hashes, branches, tags).

Example:

```
$ aragon run --client-version=fa2025232330bc3e4d3b792cab4bf44d754d33e6
```
Or

```
$ aragon run --client-version=dev
```

Closes aragon#182
  • Loading branch information
0x-r4bbit committed Sep 10, 2018
1 parent 6b92a70 commit 3255b37
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/commands/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const url = require('url')
const TX_MIN_GAS = 10e6
const CLIENT_PORT = 3000

const aragonClientVersion = pkg.aragon.clientVersion;
const defaultClientVersion = pkg.aragon.clientVersion;

exports.command = 'run'

Expand Down Expand Up @@ -86,6 +86,9 @@ exports.builder = function (yargs) {
description: 'Arguments for calling the app init function',
array: true,
default: [],
}).option('client-version', {
description: 'Version of Aragon client used to run your sandboxed app',
default: null
})
}

Expand Down Expand Up @@ -124,6 +127,7 @@ exports.handler = function ({
httpServedFrom,
appInit,
appInitArgs,
clientVersion
}) {
apmOptions.ensRegistryAddress = apmOptions['ens-registry']
const showAccounts = accounts
Expand Down Expand Up @@ -232,7 +236,8 @@ exports.handler = function ({
{
title: 'Download wrapper',
task: (ctx, task) => {
const CLIENT_PATH = `${os.homedir()}/.aragon/wrapper-${aragonClientVersion}`
clientVersion = clientVersion || defaultClientVersion
const CLIENT_PATH = `${os.homedir()}/.aragon/wrapper-${clientVersion}`
ctx.wrapperPath = CLIENT_PATH

// Make sure we haven't already downloaded the wrapper
Expand All @@ -246,12 +251,10 @@ exports.handler = function ({
fs.ensureDirSync(CLIENT_PATH)

// Clone wrapper
return clone(
'https://github.com/aragon/aragon',
CLIENT_PATH,
{ checkout: aragonClientVersion }
)
},
return clone('https://github.com/aragon/aragon', CLIENT_PATH, {
checkout: clientVersion
})
}
},
{
title: 'Install wrapper dependencies',
Expand Down

0 comments on commit 3255b37

Please sign in to comment.