-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
82 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,22 @@ | ||
// import path from 'path'; | ||
|
||
// import fetch from 'node-fetch'; | ||
import fetch from 'node-fetch'; | ||
|
||
export async function checkForLatestVersion() { | ||
// const response = await fetch( | ||
// 'https://api.github.com/repos/UofGAnalytics/build-coursework/releases/latest' | ||
// ); | ||
// const json = await response.json(); | ||
// const latestTag = json.tag_name.replace('v', ''); | ||
// const workspacePackagePath = path.join(__dirname, 'package.json'); | ||
console.log('__dirname:', __dirname); | ||
console.log('process.cwd():', process.cwd()); | ||
// const workspacePackageJson = require(workspacePackagePath); | ||
// const currentTag = workspacePackageJson.version; | ||
const response = await fetch( | ||
'https://api.github.com/repos/UofGAnalytics/build-coursework/releases/latest' | ||
); | ||
const json = await response.json(); | ||
const latestTag = json.tag_name.replace('v', ''); | ||
const currentVersion = process.env.VERSION; | ||
|
||
console.log({ latestTag, currentVersion }); | ||
|
||
// if (latestTag !== currentTag) { | ||
// console.log( | ||
// `You are running version ${currentTag} and the latest version is ${latestTag}.` | ||
// ); | ||
// console.log(`Run the following command to update:`); | ||
// console.log( | ||
// `npm install -g UofGAnalytics/build-coursework@v${latestTag}` | ||
// ); | ||
// } | ||
if (latestTag !== currentVersion) { | ||
console.log( | ||
`You are running version ${currentVersion} and the latest version is ${latestTag}.` | ||
); | ||
console.log(`Run the following command to update:`); | ||
console.log( | ||
`npm update -g UofGAnalytics/build-coursework#v${latestTag}` | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters