ramm 0.0.11 → 0.0.13
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 +8 -4
- package/dist/types/files.d.ts +1 -0
- package/package.json +1 -1
package/dist/ramm.js
CHANGED
|
@@ -279,15 +279,19 @@ var checkStrInFile = async (filePath, str) => {
|
|
|
279
279
|
}
|
|
280
280
|
return false;
|
|
281
281
|
};
|
|
282
|
-
var
|
|
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
|
package/dist/types/files.d.ts
CHANGED
package/package.json
CHANGED