Skip to content

Commit

Permalink
feat(index): update package.json version and scripts.release
Browse files Browse the repository at this point in the history
Append `-alpha` to package.json and add `release` script.
  • Loading branch information
remarkablemark committed Jun 5, 2020
1 parent 040c3c4 commit f51e1ae
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,17 @@ if (existsSync(packageJsonPath)) {
} else {
log('Unable to find `package.json`, initializing new package...');
exec('npm init --yes');
const packageJson = require(packageJsonPath);
packageJson.version = '1.0.0-alpha';
write(packageJsonPath, packageJson);
}

/**
* Update `package.json`.
*/
const packageJson = require(packageJsonPath);
packageJson.version = `${packageJson.version}-alpha`;
packageJson.scripts = packageJson.scripts || {};
packageJson.scripts.release = 'standard-version --no-verify';
write(packageJsonPath, packageJson);

/**
* Install dependencies.
*/
Expand Down

0 comments on commit f51e1ae

Please sign in to comment.