pmcf 1.24.0 → 1.24.1
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/bin/pmcf-host-defs +4 -2
- package/package.json +1 -1
package/bin/pmcf-host-defs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { writeFile, mkdir, copyFile, glob } from "node:fs/promises";
|
|
3
|
+
import { writeFile, mkdir, copyFile, glob, chmod } from "node:fs/promises";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { Host } from "pmcf";
|
|
6
6
|
import { writeLines, sectionLines } from "../src/utils.mjs";
|
|
@@ -151,7 +151,9 @@ async function copySshKeys(host, dir) {
|
|
|
151
151
|
await mkdir(sshDir, { recursive: true });
|
|
152
152
|
|
|
153
153
|
for await (const file of glob("ssh_host_*", { cwd: host.directory })) {
|
|
154
|
-
|
|
154
|
+
const destinationFileName = join(sshDir, file);
|
|
155
|
+
await copyFile(join(host.directory, file), destinationFileName);
|
|
156
|
+
await chmod(destinationFileName, destinationFileName.endsWith('.pub') ? 0o0644 : 0o0600);
|
|
155
157
|
}
|
|
156
158
|
}
|
|
157
159
|
|