Skip to content

Commit 1082c34

Browse files
authored
Merge pull request #43 from IBM/revert_windows_download_diagnostics
Revert Windows download diagnostic commits
2 parents e2f2de6 + 8ea4bc6 commit 1082c34

File tree

3 files changed

+3
-27
lines changed

3 files changed

+3
-27
lines changed

dist/index.js

Lines changed: 1 addition & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,7 @@ function colorize(string, color) {
1515
async function installCLI() {
1616
core.startGroup('Installing IBM Cloud CLI')
1717
if (process.platform == 'win32') {
18-
// Download the script to a local file
19-
await exec.exec(`powershell -command "(New-Object Net.WebClient).DownloadString('https://clis.cloud.ibm.com/install/powershell') | Out-File -FilePath ibmcloud_install.ps1"`)
20-
// Add @echo on as the first line
21-
await exec.exec(`powershell -command "'Set-PSDebug -Trace 2' + [Environment]::NewLine + (Get-Content -Path ibmcloud_install.ps1 -Raw) | Set-Content -Path ibmcloud_install.ps1"`)
22-
// Insert the new line at line 60
23-
await exec.exec(`powershell -command "$content = Get-Content -Path ibmcloud_install.ps1; $content[59] = $content[59] + [Environment]::NewLine + 'Write-Host $downloadUrl'; $content | Set-Content -Path ibmcloud_install.ps1"`)
24-
// Try a new download method
25-
await exec.exec(`powershell -command "$content = Get-Content -Path ibmcloud_install.ps1; $content[61] = '(New-Object System.Net.WebClient).DownloadFile($downloadUrl, $DownloadedInstaller)'; $content[62] = ''; $content[63] = ''; $content | Set-Content -Path ibmcloud_install.ps1"`)
26-
// Print out the script content for debugging
27-
core.info('Contents of the modified script:')
28-
await exec.exec(`powershell -command "Get-Content -Path ibmcloud_install.ps1 | ForEach-Object { Write-Output $_ }"`)
29-
// Execute the modified script
30-
await exec.exec(`powershell -File ibmcloud_install.ps1`)
18+
await exec.exec(`powershell -command "iex (New-Object Net.WebClient).DownloadString('https://clis.cloud.ibm.com/install/powershell')"`)
3119
// Add to PATH for the current step
3220
process.env.PATH += ';C:\\Program Files\\IBM\\Cloud\\bin'
3321
// Add to GITHUB_PATH for future steps

0 commit comments

Comments
 (0)