@mkterswingman/5mghost-yonder 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/sharedAuth.js +8 -1
- package/package.json +1 -1
package/dist/auth/sharedAuth.js
CHANGED
|
@@ -11,7 +11,14 @@ export function readSharedAuth(authPath) {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
export function writeSharedAuth(authPath, data) {
|
|
14
|
-
|
|
14
|
+
const authDir = dirname(authPath);
|
|
15
|
+
mkdirSync(authDir, { recursive: true });
|
|
16
|
+
try {
|
|
17
|
+
chmodSync(authDir, 0o700);
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
// Why: best-effort hardening; Windows may ignore POSIX-style directory modes.
|
|
21
|
+
}
|
|
15
22
|
const tempPath = `${authPath}.tmp`;
|
|
16
23
|
writeFileSync(tempPath, JSON.stringify(data, null, 2), { encoding: "utf8", mode: 0o600 });
|
|
17
24
|
renameSync(tempPath, authPath);
|