mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-09-11 16:16:09 +03:00
Write file to the necessary file
This commit is contained in:
parent
449136fd43
commit
93345ebdfd
@ -1,5 +1,6 @@
|
|||||||
const util = require('util');
|
const path = require('path');
|
||||||
const https = require('https');
|
const https = require('https');
|
||||||
|
const fs = require('fs').promises;
|
||||||
|
|
||||||
console.warn = () => { }
|
console.warn = () => { }
|
||||||
|
|
||||||
@ -41,9 +42,10 @@ function createFile([elmJson, docsJson]) {
|
|||||||
flags: { elmJson, docsJson }
|
flags: { elmJson, docsJson }
|
||||||
});
|
});
|
||||||
|
|
||||||
app.ports.sendToJs.subscribe(result => {
|
app.ports.sendToJs.subscribe(async ([filePath, source]) => {
|
||||||
console.log(result);
|
const relativeFilePath = path.resolve(process.cwd(), filePath);
|
||||||
process.exit(0);
|
await fs.mkdir(path.dirname(relativeFilePath), { recursive: true });
|
||||||
|
await fs.writeFile(relativeFilePath, source);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user