Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Commit

Permalink
dont run version checker during testing
Browse files Browse the repository at this point in the history
  • Loading branch information
redreceipt committed Jun 3, 2022
1 parent d7c903c commit 0dafced
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion __tests__/__snapshots__/index.tests.js.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`gets the version 1`] = `"0.1.1"`;
exports[`gets the version 1`] = `"0.1.2"`;
12 changes: 7 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ program.name('apollos');
program.version(version);

// check version
const { stdout: latest } = execaSync(`${scriptsDir}/get-latest-version.sh`);
if (latest !== version) {
consola.warn(
`Apollos CLI current version: ${version}. Newer version is available: ${latest}`,
);
if (process.env.NODE_ENV !== 'test') {
const { stdout: latest } = execaSync(`${scriptsDir}/get-latest-version.sh`);
if (latest !== version) {
consola.warn(
`Apollos CLI current version: ${version}. Newer version is available: ${latest}`,
);
}
}

program.addCommand(makeMobileCommand());
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"standard-version": {
"scripts": {
"prerelease": "yarn test -t version -u",
"postbump": "yarn test -t version -u",
"postchangelog": "sed -i \"\" \"s/### \\[/## \\[/g\" CHANGELOG.md",
"posttag": "git push --follow-tags origin master && yarn publish . && gh-release --yes"
}
Expand Down

0 comments on commit 0dafced

Please sign in to comment.