mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
🐛 CLI: Add windows support to import:workflow --separate (#2441)
This commit is contained in:
@@ -86,9 +86,12 @@ export class ImportWorkflowsCommand extends Command {
|
|||||||
const credentialsEntities = (await Db.collections.Credentials?.find()) ?? [];
|
const credentialsEntities = (await Db.collections.Credentials?.find()) ?? [];
|
||||||
let i;
|
let i;
|
||||||
if (flags.separate) {
|
if (flags.separate) {
|
||||||
const files = await glob(
|
let inputPath = flags.input;
|
||||||
`${flags.input.endsWith(path.sep) ? flags.input : flags.input + path.sep}*.json`,
|
if (process.platform === 'win32') {
|
||||||
);
|
inputPath = inputPath.replace(/\\/g, '/');
|
||||||
|
}
|
||||||
|
inputPath = inputPath.replace(/\/$/g, '');
|
||||||
|
const files = await glob(`${inputPath}/*.json`);
|
||||||
for (i = 0; i < files.length; i++) {
|
for (i = 0; i < files.length; i++) {
|
||||||
const workflow = JSON.parse(fs.readFileSync(files[i], { encoding: 'utf8' }));
|
const workflow = JSON.parse(fs.readFileSync(files[i], { encoding: 'utf8' }));
|
||||||
if (credentialsEntities.length > 0) {
|
if (credentialsEntities.length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user