Created
October 2, 2017 02:49
-
-
Save brcolow/018689c820762fdb31b0b0e5d2771909 to your computer and use it in GitHub Desktop.
win_sudo.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const download = spawnSync('powershell.exe', ['-ExecutionPolicy', 'Bypass', '-NoLogo', '-NonInteractive', '-NoProfile', | |
'-Command', `"Invoke-WebRequest -Uri 'https://github.com/mattn/sudo/releases/download/v0.0.1/sudo-x86_64.zip' -OutFile '${paths.composer.binaryPath}\\sudo-x86_64.zip'"`], { stdio: 'inherit', encoding: 'utf8', shell: true }); | |
const unzip = spawnSync('powershell.exe', ['-ExecutionPolicy', 'Bypass', '-NoLogo', '-NonInteractive', '-NoProfile', | |
'-Command', `"Add-Type -AssemblyName System.IO.Compression.FileSystem;[System.IO.Compression.ZipFile]::ExtractToDirectory('${paths.composer.binaryPath}\\sudo-x86_64.zip', '${paths.composer.binaryPath}\\sudo-x86_64');"`], { stdio: 'inherit', encoding: 'utf8', shell: true }); | |
$.util.log($.util.colors.bgRed(`Download status: ${download.status} - unzip status: ${unzip.status}`)); | |
$.util.log($.util.colors.bgRed(`Download error: ${download.signal} - unzip error: ${unzip.signal}`)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment