ramm 0.0.13 → 0.0.14

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/ramm.js CHANGED
@@ -239,6 +239,7 @@ EOF`);
239
239
  };
240
240
  // src/files.ts
241
241
  import { appendFile, exists } from "fs/promises";
242
+ var {write } = globalThis.Bun;
242
243
 
243
244
  // src/path.ts
244
245
  import { homedir } from "os";
@@ -294,6 +295,11 @@ var writeIfNew = async (rawFilePath, str) => {
294
295
  }
295
296
  await appendFile(filePath, finalizeWithNewline(str));
296
297
  };
298
+ var writeFile = async (pathToFile, str) => {
299
+ const normalizedPath = normalizePath(pathToFile);
300
+ await createFileIfNeed(normalizedPath);
301
+ await write(normalizedPath, str);
302
+ };
297
303
  // src/ssh.ts
298
304
  import { debug } from "console";
299
305
  var addKeyToHostConfig = async (pathToHost, address, pathToKey) => {
@@ -335,6 +341,7 @@ var createAndAddSshKey = async (pathToKey, comment, context) => {
335
341
  };
336
342
  export {
337
343
  writeIfNew,
344
+ writeFile,
338
345
  setupNftable,
339
346
  runPodmanContainerService,
340
347
  runPodmanContainer,
@@ -7,6 +7,6 @@ export { restartSystemdService } from "./systemd.ts";
7
7
  export { installSystemPackage } from "./packages.ts";
8
8
  export { debugBlock } from "./debug.ts";
9
9
  export { setupNftable } from "./nft.ts";
10
- export { writeIfNew } from "./files.ts";
10
+ export { writeIfNew, writeFile } from "./files.ts";
11
11
  export { createAndAddSshKey, getServerFingerprintBySsh, addKeyToHostConfig, } from "./ssh.ts";
12
12
  export { normalizePath } from "./path.ts";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ramm",
3
3
  "type": "module",
4
- "version": "0.0.13",
4
+ "version": "0.0.14",
5
5
  "scripts": {
6
6
  "build": "bun build ./src/ramm.ts --target bun --outdir ./dist && cp ./src/bun.sh ./dist/bun.sh && bun run types",
7
7
  "types": "tsc --project tsconfig.types.json"