Skip to content

Commit

Permalink
Merge pull request #64 from WyriHaximus/use-system-temp-dir-for-kube-…
Browse files Browse the repository at this point in the history
…and-helm-cache-dirs

Use system temp dir for kube and helm cache dirs
  • Loading branch information
WyriHaximus authored Feb 23, 2023
2 parents 45bd873 + 0eb98cb commit 8c8247c
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 8c8247c

Please sign in to comment.