|
|
@ -2,19 +2,19 @@ |
|
|
import execa from 'execa'; |
|
|
import execa from 'execa'; |
|
|
import fse from 'fs-extra'; |
|
|
import fse from 'fs-extra'; |
|
|
|
|
|
|
|
|
const versions = ['major', 'minor', 'patch', 'premajor', 'preminor', 'prepatch', 'prerelease']; |
|
|
const publish = async () => { |
|
|
let nextSemanticVersion = (process.argv[2] || '').toLowerCase(); |
|
|
const versions = ['major', 'minor', 'patch', 'premajor', 'preminor', 'prepatch', 'prerelease']; |
|
|
|
|
|
let nextSemanticVersion = (process.argv[2] || '').toLowerCase(); |
|
|
if (versions.indexOf(nextSemanticVersion) < 0) { |
|
|
|
|
|
console.log( |
|
|
if (versions.indexOf(nextSemanticVersion) < 0) { |
|
|
"Please enter the next semantic version like this: 'npm run publish patch'. Available versions:\n " + |
|
|
console.log( |
|
|
JSON.stringify(versions), |
|
|
"Please enter the next semantic version like this: 'npm run publish patch'. Available versions:\n " + |
|
|
); |
|
|
JSON.stringify(versions), |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
process.exit(1); |
|
|
process.exit(1); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
(async () => { |
|
|
|
|
|
try { |
|
|
try { |
|
|
await execa('yarn', ['install-new-dependencies'], { stdout: 'inherit' }); |
|
|
await execa('yarn', ['install-new-dependencies'], { stdout: 'inherit' }); |
|
|
|
|
|
|
|
|
@ -51,4 +51,8 @@ if (versions.indexOf(nextSemanticVersion) < 0) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
process.exit(0); |
|
|
process.exit(0); |
|
|
})(); |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
publish(); |
|
|
|
|
|
|
|
|
|
|
|
export default publish(); |
|
|
|