ramm 0.0.11 → 0.0.12

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
@@ -279,15 +279,19 @@ var checkStrInFile = async (filePath, str) => {
279
279
  }
280
280
  return false;
281
281
  };
282
- var writeIfNew = async (rawFilePath, str) => {
282
+ var createFileIfNeed = async (rawFilePath) => {
283
283
  const filePath = normalizePath(rawFilePath);
284
284
  await createDir(filePath);
285
- if (await checkStrInFile(filePath, str)) {
286
- return;
287
- }
288
285
  if (!await Bun.file(filePath).exists()) {
289
286
  await execCommand(`touch ${filePath}`);
290
287
  }
288
+ };
289
+ var writeIfNew = async (rawFilePath, str) => {
290
+ const filePath = normalizePath(rawFilePath);
291
+ await createFileIfNeed(filePath);
292
+ if (await checkStrInFile(filePath, str)) {
293
+ return;
294
+ }
291
295
  await appendFile(filePath, finalizeWithNewline(str));
292
296
  };
293
297
  // src/ssh.ts
@@ -1 +1,2 @@
1
1
  export declare const writeIfNew: (rawFilePath: string, str: string) => Promise<void>;
2
+ export declare const writeFile: (pathToFile: string, str: string) => Promise<void>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ramm",
3
3
  "type": "module",
4
- "version": "0.0.11",
4
+ "version": "0.0.12",
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"