ic-mops 0.12.0 → 0.12.2

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.
@@ -132,7 +132,7 @@ export async function sources({verbose} = {}) {
132
132
  }
133
133
 
134
134
  // use pkgDir if baseDir doesn't exist for local packages
135
- if (pkg.path && !fs.existsSync(pkgBaseDir) && fs.existsSync(pkgDir)) {
135
+ if (pkg.path && !fs.existsSync(pkgBaseDir)) {
136
136
  pkgBaseDir = pkgDir;
137
137
  }
138
138
 
package/mops.js CHANGED
@@ -125,7 +125,7 @@ export function checkConfigFile() {
125
125
 
126
126
  export function progressBar(step, total) {
127
127
  let done = Math.round(step / total * 10);
128
- return `[${':'.repeat(done)}${' '.repeat(10 - done)}]`;
128
+ return `[${':'.repeat(done)}${' '.repeat(Math.max(0, 10 - done))}]`;
129
129
  }
130
130
 
131
131
  export async function getHighestVersion(pkgName) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ic-mops",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mops": "cli.js"
package/vessel.js CHANGED
@@ -77,6 +77,9 @@ export const downloadFromGithub = async (repo, dest, onProgress = null) => {
77
77
  const readStream = got.stream(zipFile);
78
78
 
79
79
  const promise = new Promise((resolve, reject) => {
80
+ readStream.on('error', (err) => {
81
+ reject(err);
82
+ });
80
83
 
81
84
  readStream.on('downloadProgress', ({transferred, total}) => {
82
85
  onProgress?.(transferred, total || 2 * (1024 ** 2));
@@ -153,10 +156,14 @@ export const installFromGithub = async (name, repo, options = {}) => {
153
156
  };
154
157
 
155
158
  progress(0, 2 * (1024 ** 2));
156
- await downloadFromGithub(repo, dir, progress).catch((err) => {
159
+
160
+ try {
161
+ await downloadFromGithub(repo, dir, progress);
162
+ }
163
+ catch (err) {
157
164
  del.sync([dir]);
158
- console.log(chalk.red('Error: ') + err);
159
- });
165
+ throw err;
166
+ }
160
167
 
161
168
  // add to cache
162
169
  await addCache(cacheName, dir);