fix(build): migrate project config to .smartconfig.json and replace smartfile usage with native fs
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import * as plugins from './smartfile-destination-file.plugins.js';
|
||||
import * as plugins from './plugins.js';
|
||||
|
||||
export class SmartlogDestinationFile implements plugins.smartlogInterfaces.ILogDestination {
|
||||
public fileWriteStream: plugins.fs.WriteStream;
|
||||
@@ -12,7 +12,10 @@ export class SmartlogDestinationFile implements plugins.smartlogInterfaces.ILogD
|
||||
if (!plugins.path.isAbsolute(filePathArg)) {
|
||||
throw new Error(`filePath needs to be absolute but is not: "${filePathArg}"`);
|
||||
}
|
||||
plugins.smartfile.fs.ensureFileSync(filePathArg, `# Smartlogfile. Created at ${extendedDate.toISOString()}\n`);
|
||||
if (!plugins.fs.existsSync(filePathArg)) {
|
||||
plugins.fs.mkdirSync(plugins.path.dirname(filePathArg), { recursive: true });
|
||||
plugins.fs.writeFileSync(filePathArg, `# Smartlogfile. Created at ${extendedDate.toISOString()}\n`);
|
||||
}
|
||||
this.fileWriteStream = plugins.fs.createWriteStream(
|
||||
filePathArg,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user