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

dash-generate-components crashes on windows #915

Merged
merged 5 commits into from
Sep 9, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion dash/development/component_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ def generate_components(
reserved_patterns = "|".join("^{}$".format(p) for p in reserved_words)

os.environ["NODE_PATH"] = "node_modules"

fmt = "node {} \"{}\" \"{}\" {}" if is_windows else "node {} {} {} {}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @stevej2608 !
Is it necessary that this change is only made on Windows? Can't we just always quote these arguments? Obviously we (Plotly devs) don't build on Windows very often, so I worry it'll just break again if Windows has special code.


cmd = shlex.split(
"node {} {} {} {}".format(
fmt.format(
extract_path, ignore, reserved_patterns, components_source
),
posix=not is_windows,
Expand Down
2 changes: 1 addition & 1 deletion dash/extract-meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const path = require('path');
const reactDocs = require('react-docgen');

const componentPaths = process.argv.slice(4);
const ignorePattern = new RegExp(process.argv[2]);
const ignorePattern = new RegExp(process.argv[2].split('"').join(''));
const reservedPatterns = process.argv[3].split('|').map(part => new RegExp(part));

let failed = false;
Expand Down