@canvas-medical/heads-up
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -11,2 +11,3 @@ #!/usr/bin/env node | ||
const fs = require('fs').promises; | ||
const lol = require('lolcatjs'); | ||
const moment = require('moment'); | ||
@@ -20,4 +21,7 @@ const octokit = require('@octokit/rest')(); | ||
const tmp = require('tmp-promise'); | ||
const updateCheck = require('update-check'); | ||
const { spawn } = require('child-process-promise'); | ||
const pkg = require('./package.json'); | ||
process.emitWarning = originalEmitWarning; | ||
@@ -32,4 +36,35 @@ | ||
const FIREWORKS = ` | ||
.''. | ||
.''. *''* :_\\/_: . | ||
:_\\/_: . .:.*_\\/_* : /\\ : .'.:.'. | ||
.''.: /\\ : _\\(/_ ':'* /\\ * : '..'. -=:o:=- | ||
:_\\/_:'.:::. /)\\*''* .|.* '.\\'/.'_\\(/_'.':'.' | ||
: /\\ : ::::: '*_\\/_* | | -= o =- /)\\ ' * | ||
'..' ':::' * /\\ * |'| .'/.\\'. '._____ | ||
* __*..* | | : |. |' .---"| | ||
_* .-' '-. | | .--'| || | _| | | ||
.-'| _.| | || '-__ | | | || | | ||
|' | |. | || | | | | || | | ||
___| '-' ' "" '-' '-.' '\` |____ | ||
jgs~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`; | ||
const editor = process.env.EDITOR || DEFAULT_EDITOR; | ||
async function checkForUpdate() { | ||
let update; | ||
try { | ||
update = await updateCheck(pkg); | ||
} catch (err) { | ||
console.error(`Failed to check for updates: ${err}`); | ||
} | ||
if (update) { | ||
console.log( | ||
`The latest version is ${update.latest}. Please update with \`npm install -g ${pkg.name}\`.` | ||
); | ||
} | ||
} | ||
async function launchEditor(defaultContents = '') { | ||
@@ -154,2 +189,4 @@ const { path: filename, cleanup } = await tmp.file({ postfix: '.md' }); | ||
console.log(`Created ${created.data.html_url}`); | ||
lol.fromString(FIREWORKS); | ||
} | ||
@@ -217,2 +254,4 @@ } | ||
await checkForUpdate(); | ||
if (!process.argv.slice(2).length) { | ||
@@ -219,0 +258,0 @@ program.outputHelp(); |
{ | ||
"name": "@canvas-medical/heads-up", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -18,5 +18,7 @@ "main": "heads-up.js", | ||
"commander": "^2.18.0", | ||
"lolcatjs": "^2.3.2", | ||
"moment": "^2.22.2", | ||
"opn": "^5.4.0", | ||
"tmp-promise": "^1.0.5" | ||
"tmp-promise": "^1.0.5", | ||
"update-check": "^1.5.2" | ||
}, | ||
@@ -23,0 +25,0 @@ "devDependencies": { |
8099
212
8
+ Addedlolcatjs@^2.3.2
+ Addedupdate-check@^1.5.2
+ Addedansi@0.3.1(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedchalk@3.0.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addeddeep-extend@0.6.0(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedini@1.3.8(transitive)
+ Addedline-by-line@0.1.6(transitive)
+ Addedlolcatjs@2.4.3(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addednan@2.22.0(transitive)
+ Addedrc@1.2.8(transitive)
+ Addedregistry-auth-token@3.3.2(transitive)
+ Addedregistry-url@3.1.0(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsleep@6.3.0(transitive)
+ Addedstrip-json-comments@2.0.1(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedupdate-check@1.5.4(transitive)