Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 CLI: Add windows support to import:workflow --separate #2441

Merged
merged 1 commit into from
Nov 19, 2021

Conversation

that-one-tom
Copy link
Contributor

This PR addresses a bug reported in the community. The CLI command n8n import:workflow --separate would fail on Windows because the fast-glob package requires forward-slashes for patterns (while Windows uses backslashes in paths).

This PR introduces a quick check for process.platform === 'win32' and converts backslashes accordingly if true.

It also removes potentially trailing slashes from the path since one will be appended as part of the pattern (I only did this because the linter complained about the old format).

Tested this on Windows 11 using:

.\packages\cli\bin\n8n import:workflow --separate --input=C:\Users\Tom\Desktop\test
.\packages\cli\bin\n8n import:workflow --separate --input=C:\Users\Tom\Desktop\test\

Workflows were imported in both cases. Also tested this on Ubuntu 20.04 using:

./packages/cli/bin/n8n import:workflow --separate --input=/mnt/c/Users/Tom/Desktop/test
./packages/cli/bin/n8n import:workflow --separate --input=/mnt/c/Users/Tom/Desktop/test/

Again workflows were imported in both cases.

@janober janober merged commit d22a4b1 into n8n-io:master Nov 19, 2021
@janober
Copy link
Member

janober commented Nov 19, 2021

Thanks a lot. Got merged.

@janober
Copy link
Member

janober commented Nov 19, 2021

Got released with n8n@0.150.0

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Jun 1, 2022
@janober janober added Upcoming Release Will be part of the upcoming release and removed Upcoming Release Will be part of the upcoming release labels Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants