@stonyx/utils 0.0.4 → 0.1.0
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/package.json +1 -1
- package/src/file.js +1 -1
package/package.json
CHANGED
package/src/file.js
CHANGED
|
@@ -18,7 +18,7 @@ export async function updateFile(filePath, data, { json }) {
|
|
|
18
18
|
|
|
19
19
|
const swapFile = `${filePath}.temp-${getTimestamp()}`;
|
|
20
20
|
await fsp.writeFile(swapFile, json ? objToJson(data) : data);
|
|
21
|
-
await fsp.rename(swapFile,
|
|
21
|
+
await fsp.rename(swapFile, filePath);
|
|
22
22
|
} catch (error) {
|
|
23
23
|
|
|
24
24
|
throw new Error(error);
|