milkee 2.2.0-dev.4 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/main.js +17 -5
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Generated by CoffeeScript 2.7.0
2
2
  (function() {
3
- var CONFIG_FILE, CONFIG_PATH, CWD, argv, checkCoffee, checkLatest, compile, consola, crypto, exec, executePlugins, fs, getCompiledFiles, hideBin, isPackageLatest, path, pkg, runPlugins, setup, spawn, yargs;
3
+ var CONFIG_FILE, CONFIG_PATH, CWD, argv, checkCoffee, checkLatest, compile, consola, crypto, exec, executePlugins, fs, getCompiledFiles, hideBin, isPackageLatest, path, pkg, runPlugins, setup, sleep, spawn, yargs;
4
4
 
5
5
  yargs = require('yargs');
6
6
 
@@ -26,19 +26,28 @@
26
26
 
27
27
  CONFIG_PATH = path.join(CWD, CONFIG_FILE);
28
28
 
29
+ sleep = function(time) {
30
+ return new Promise(function(resolve) {
31
+ return setTimeout(resolve, time);
32
+ });
33
+ };
34
+
29
35
  // async
30
36
  checkLatest = async function() {
31
37
  var res;
32
38
  try {
33
39
  res = (await isPackageLatest(pkg));
34
40
  if (res.success && !res.isLatest) {
35
- return consola.box({
41
+ consola.box({
36
42
  title: "A new version is now available!",
37
43
  message: `${res.currentVersion} --> \`${res.latestVersion}\`\n\n# global installation\n\`npm i -g milkee@latest\`\n\n# or local installation\n\`npm i -D milkee@latest\`\n`
38
44
  });
45
+ return true;
46
+ } else {
47
+ return false;
39
48
  }
40
49
  } catch (error1) {
41
- return null;
50
+ return false;
42
51
  }
43
52
  };
44
53
 
@@ -179,8 +188,11 @@
179
188
 
180
189
  // async
181
190
  compile = async function() {
182
- var backupFiles, backupName, backupPath, clearBackups, compilerProcess, config, debounceTimeout, dirName, enabledOptions, enabledOptionsList, error, execCommand, execCommandParts, execOtherOptionStrings, fileName, hash, i, item, items, lastError, len, milkee, milkeeOptions, options, originalPath, restoreBackups, spawnArgs, stat, summary, targetDir, toContinue;
183
- await checkLatest();
191
+ var backupFiles, backupName, backupPath, cl, clearBackups, compilerProcess, config, debounceTimeout, dirName, enabledOptions, enabledOptionsList, error, execCommand, execCommandParts, execOtherOptionStrings, fileName, hash, i, item, items, lastError, len, milkee, milkeeOptions, options, originalPath, restoreBackups, spawnArgs, stat, summary, targetDir, toContinue;
192
+ cl = (await checkLatest());
193
+ if (cl) {
194
+ await sleep(1000);
195
+ }
184
196
  checkCoffee();
185
197
  if (!fs.existsSync(CONFIG_PATH)) {
186
198
  consola.error(`\`${CONFIG_FILE}\` not found in this directory: ${CWD}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "milkee",
3
- "version": "2.2.0-dev.4",
3
+ "version": "2.2.0",
4
4
  "description": "A simple CoffeeScript build tool with coffee.config.cjs",
5
5
  "main": "dist/main.js",
6
6
  "bin": {