Prechádzať zdrojové kódy

fix(util): fix wrong error hints in extracting

evshiron 8 rokov pred
rodič
commit
80e7e3b11a
2 zmenil súbory, kde vykonal 5 pridanie a 5 odobranie
  1. 4 0
      docs/FAQs.md
  2. 1 5
      src/lib/util/archive.ts

+ 4 - 0
docs/FAQs.md

@@ -52,3 +52,7 @@ Also configurations should be set in `manifest.json` instead of `package.json` b
 `nsis` target will build NSIS installers (and updaters when `package.json:build.nsis.diffUpdaters` is `true`) for Windows.
 
 `nsis7z` target will use `7za` to compress and [Nsis7z plug-in](http://nsis.sourceforge.net/Nsis7z_plug-in) to extract, instead of the built-in LZMA compression, resulting in a better and faster compression. But it doesn't list installed files, only a percentage indicating the progress of extraction when installing.
+
+> `Error: ERROR_EXTRACTING archive = xxx`?
+
+Remove the archive and try again. Usually it's because of the broken extracted `.tar`. If removing doesn't fix, feel free to post issues.

+ 1 - 5
src/lib/util/archive.ts

@@ -21,12 +21,8 @@ async function extract(archive: string, dest: string = dirname(archive), options
 
     const { code, signal } = await spawnAsync(path7za, [ 'x', '-y', `-ao${ options.overwrite ? 'a' : 's' }`, `-o${ resolve(dest) }`, resolve(archive) ]);
 
-    if(code == 2) {
-        throw new Error(`ERROR_PATH_NOT_FOUND path = ${ archive }`);
-    }
-
     if(code != 0) {
-        throw new Error(`ERROR_EXIT_CODE code = ${ code }`);
+        throw new Error(`ERROR_EXTRACTING path = ${ archive }`);
     }
 
     return dest;