MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / getTmpDir

Function getTmpDir

hooks/post-process.js:46–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44
45
46function getTmpDir() {
47 const tmpdirEnv = process.env.TMPDIR;
48
49 if (tmpdirEnv) {
50 try {
51 fs.accessSync(tmpdirEnv, fs.constants.R_OK | fs.constants.W_OK);
52 return tmpdirEnv;
53 } catch {
54 // TMPDIR exists but not accessible
55 }
56 }
57
58 try {
59 fs.accessSync("/tmp", fs.constants.R_OK | fs.constants.W_OK);
60 return "/tmp";
61 } catch {
62 console.log("Error: No usable temporary directory found (TMPDIR or /tmp not accessible).");
63 return null;
64 // process.exit(1);
65 }
66}
67
68function patchTargetSdkVersion() {
69 const prefix = execSync('npm prefix').toString().trim();

Callers 1

patchTargetSdkVersionFunction · 0.85

Calls 1

logMethod · 0.80

Tested by

no test coverage detected