Skip to content

Commit

Permalink
build: fix publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
sualko committed May 6, 2020
1 parent 8da525e commit 4563235
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/publish-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async function isRepoClean() {
throw 'Repo not clean. Found staged files.';
}

if (status.modified.length > 0) {
if (status.modified.length > 2 || !status.modified.includes('package.json') || !status.modified.includes('appinfo/info.xml')) {
throw 'Repo not clean. Found modified files.';
}

Expand Down Expand Up @@ -163,7 +163,7 @@ function hasChangeLogEntry() {
fs.readFile(path.join(__dirname, '..', 'CHANGELOG.md'), function (err, data) {
if (err) throw err;

if (!data.includes(`## ${package.version}`)) {
if (!data.includes(`## ${package.version}`) && package.version.match(/^\d+\.\d+\.\d+$/)) {
throw `Found no change log entry for ${package.version}`;
}

Expand Down Expand Up @@ -381,10 +381,10 @@ async function run() {
await pull();
console.log('✔ pulled latest changes'.green);

// await isRepoClean();
await isRepoClean();
console.log('✔ repo is clean'.green);

// await notAlreadyTagged();
await notAlreadyTagged();
console.log('✔ not already tagged'.green);

await lastCommitNotBuild();
Expand All @@ -399,6 +399,8 @@ async function run() {
changeLog = await editChangeLog(changeLog);
console.log('✔ change log updated'.green);

console.log(changeLog);

console.log('Press any key to continue...');
await keypress();

Expand Down

0 comments on commit 4563235

Please sign in to comment.