mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(core): Replace promisify-d node calls with native promises (no-changelog) (#8464)
This commit is contained in:
committed by
GitHub
parent
238b54c77b
commit
5cb55270b7
@@ -1,13 +1,7 @@
|
||||
import * as fs from 'fs';
|
||||
import { copyFile } from 'fs/promises';
|
||||
import type { ReplaceInFileConfig } from 'replace-in-file';
|
||||
import { replaceInFile } from 'replace-in-file';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires
|
||||
const { promisify } = require('util');
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
||||
const fsCopyFile = promisify(fs.copyFile);
|
||||
|
||||
/**
|
||||
* Creates a new credentials or node
|
||||
*
|
||||
@@ -22,7 +16,7 @@ export async function createTemplate(
|
||||
): Promise<void> {
|
||||
// Copy the file to then replace the values in it
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
await fsCopyFile(sourceFilePath, destinationFilePath);
|
||||
await copyFile(sourceFilePath, destinationFilePath);
|
||||
|
||||
// Replace the variables in the template file
|
||||
const options: ReplaceInFileConfig = {
|
||||
|
||||
Reference in New Issue
Block a user