Skip to content

Commit

Permalink
[changed] all options has been moved under the common json node
Browse files Browse the repository at this point in the history
"release-script" in package.json
  • Loading branch information
AlexKVal committed Jul 13, 2015
1 parent 2596713 commit 556ad50
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ Say the name of your project is:
Then name `bower` github repo as:
`original-project-name-bower`.

Add `bowerRepo` into your `package.json`:
Add `'release-script'.bowerRepo` into your `package.json`:
```js
"bowerRepo": "[email protected]:<author>/original-project-name-bower.git",
"release-script": {
"bowerRepo": "[email protected]:<author>/original-project-name-bower.git"
}
```

Then add additional step into your building process,
Expand Down Expand Up @@ -63,9 +65,11 @@ that have been written by [Matt Smith @mtscout6](https://github.com/mtscout6)
> npm install -D release-script
```

Set `bowerRepo` into your `package.json` if you need `bower` releases too.
Set `'release-script'.bowerRepo` into your `package.json` if you need `bower` releases too.
```js
"bowerRepo": "[email protected]:<org-author-name>/<name-of-project>-bower.git",
"release-script": {
"bowerRepo": "[email protected]:<org-author-name>/<name-of-project>-bower.git"
}
```

Then you can release like that:
Expand Down
7 changes: 4 additions & 3 deletions src/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ const changelog = path.join(repoRoot, 'CHANGELOG.md');

const npmjson = JSON.parse(cat(packagePath));

const bowerRoot = path.join(repoRoot, (npmjson.bowerRoot || 'amd/'));
const tmpBowerRepo = path.join(repoRoot, (npmjson.tmpBowerRepo || 'tmp-bower-repo'));
const configOptions = npmjson['release-script'] || {};
const bowerRoot = path.join(repoRoot, (configOptions.bowerRoot || 'amd/'));
const tmpBowerRepo = path.join(repoRoot, (configOptions.tmpBowerRepo || 'tmp-bower-repo'));

// let bowerRepo;
// if (npmjson.bowerRepo) {
Expand All @@ -31,7 +32,7 @@ const tmpBowerRepo = path.join(repoRoot, (npmjson.tmpBowerRepo || 'tmp-bower-rep
// gitUrlBase = gitUrlBase || npmjson.repository.url;
// bowerRepo = `[email protected]:${gitUrlBase}-bower.git`;
// }
const bowerRepo = npmjson.bowerRepo; // if it is not set, then there is no bower repo
const bowerRepo = configOptions.bowerRepo; // if it is not set, then there is no bower repo

//------------------------------------------------------------------------------
// command line options
Expand Down

0 comments on commit 556ad50

Please sign in to comment.