@datacamp/learn-vm-scripts 0.0.1-rc.10 → 0.0.1-rc.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/index.cjs +9 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -95429,6 +95429,14 @@ var handleInput = async ({
|
|
|
95429
95429
|
console.error(source_default.red(`Error: ${error.message}`));
|
|
95430
95430
|
}
|
|
95431
95431
|
};
|
|
95432
|
+
var createFileIfNotExists = async (filePath) => {
|
|
95433
|
+
try {
|
|
95434
|
+
await fs6.access(filePath);
|
|
95435
|
+
} catch {
|
|
95436
|
+
const handle = await fs6.open(filePath, "w");
|
|
95437
|
+
await handle.close();
|
|
95438
|
+
}
|
|
95439
|
+
};
|
|
95432
95440
|
var startInputWatcher = async ({
|
|
95433
95441
|
inputFilePath,
|
|
95434
95442
|
outputFilePath,
|
|
@@ -95436,6 +95444,7 @@ var startInputWatcher = async ({
|
|
|
95436
95444
|
userDataDir
|
|
95437
95445
|
}) => {
|
|
95438
95446
|
const outputFileHandle = await fs6.open(outputFilePath, "a");
|
|
95447
|
+
await createFileIfNotExists(inputFilePath);
|
|
95439
95448
|
for await (const event of fs6.watch(inputFilePath)) {
|
|
95440
95449
|
if (event.eventType !== "change") {
|
|
95441
95450
|
continue;
|
package/package.json
CHANGED