File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,17 @@ import bin from './index.js';
55
66( async ( ) => {
77 try {
8+ // On linux platforms with non-intel architectures, bin-wrapper still
9+ // downloads and tries to execute the x86_64 ELF. This results in the
10+ // binary file being interpreted as a shell script, which creates a
11+ // dangling file that can make npm or yarn crash at installation. This
12+ // condition prevents this from happening.
13+ //
14+ // See https://github.com/imagemin/gifsicle-bin/issues/124#issuecomment-1222646680
15+ if ( process . platform === 'linux' && ! [ 'ia32' , 'x64' ] . includes ( process . arch ) ) {
16+ throw Error ( `Unsupported platform: ${ process . platform } /${ process . arch } .` ) ;
17+ }
18+
819 await bin . run ( [ '--version' ] ) ;
920 console . log ( 'optipng pre-build test passed successfully' ) ;
1021 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments