Skip to content

Commit

Permalink
Merge pull request #125 from stephendotcarter/use-cp-rm
Browse files Browse the repository at this point in the history
Copy the file and remove the original
  • Loading branch information
medyagh authored Apr 11, 2023
2 parents 3ef07db + 5d9b9bf commit 3213bac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ const downloadMinikube = (version) => __awaiter(void 0, void 0, void 0, function
const binPath = (0, os_1.platform)() === 'darwin' ? '/Users/runner/bin' : '/home/runner/bin';
yield (0, io_1.mkdirP)(binPath);
yield (0, exec_1.exec)('chmod', ['+x', downloadPath]);
yield (0, io_1.mv)(downloadPath, (0, path_1.join)(binPath, 'minikube'));
yield (0, io_1.cp)(downloadPath, (0, path_1.join)(binPath, 'minikube'));
yield (0, io_1.rmRF)(downloadPath);
(0, core_1.addPath)(binPath);
});
exports.downloadMinikube = downloadMinikube;
Expand Down
5 changes: 3 additions & 2 deletions src/download.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {addPath} from '@actions/core'
import {exec} from '@actions/exec'
import {mkdirP, mv} from '@actions/io'
import {mkdirP, cp, rmRF} from '@actions/io'
import {downloadTool} from '@actions/tool-cache'
import {platform as getPlatform} from 'os'
import {join} from 'path'
Expand All @@ -26,6 +26,7 @@ export const downloadMinikube = async (version: string): Promise<void> => {
getPlatform() === 'darwin' ? '/Users/runner/bin' : '/home/runner/bin'
await mkdirP(binPath)
await exec('chmod', ['+x', downloadPath])
await mv(downloadPath, join(binPath, 'minikube'))
await cp(downloadPath, join(binPath, 'minikube'))
await rmRF(downloadPath)
addPath(binPath)
}

0 comments on commit 3213bac

Please sign in to comment.