Skip to content

Commit

Permalink
Use system temp dir for kube and helm cache dirs
Browse files Browse the repository at this point in the history
Resolves #63
  • Loading branch information
WyriHaximus authored Feb 23, 2023
1 parent 45bd873 commit 0eb98cb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
async function main() {
const homedir = require('os').homedir();
const tempdir = require('os').tmpdir();
const fs = require('fs');
const {execFile} = require('child_process');
const tmp = require('tmp');
Expand All @@ -15,12 +16,12 @@ async function main() {
postfix: '.sh',
discardDescriptor: true,
});
const dockerKubeConfigDir = process.cwd() + '/docker-kube-config-' + Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 13);
const dockerKubeConfigDir = tempdir + '/docker-kube-config-' + Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 13);
fs.mkdirSync(dockerKubeConfigDir, {
mode: 0o777,
});
const dockerKubeConfig = dockerKubeConfigDir + '/config';
const helmCacheDir = process.cwd() + '/helm-cache-' + Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 13);
const helmCacheDir = tempdir + '/helm-cache-' + Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 13);
fs.mkdirSync(helmCacheDir, {
mode: 0o744,
});
Expand Down

0 comments on commit 0eb98cb

Please sign in to comment.