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

devon build command not working correct for yarn or npm #431

Closed
hohwille opened this issue Jul 7, 2020 · 1 comment · Fixed by #448
Closed

devon build command not working correct for yarn or npm #431

hohwille opened this issue Jul 7, 2020 · 1 comment · Fixed by #448
Labels
bug Something isn't working commandlet related to commandlets (scripts/command/*) javascript related to JavaScript tooling (node, npm, ng, etc.) scripts related to shell scripts (bash and CMD)

Comments

@hohwille
Copy link
Member

hohwille commented Jul 7, 2020

As discussed in PR #417 the command devon build for yarn or in other words the command devon yarn build is not working correct.
It invokes yarn build. However, dependencies may not be installed and not every project may have a build script.
IMHO the same applies for npm as well.

The JavaScript ecosystem is less standardized so there are no clear goals and guidelines for this (other than for maven or gradle).
To me the build of a project should behave a following:

  • install dependencies (yarn install or npm install)
  • run build script if present (yarn run build or npm run build if build section is present in scripts section of package.json)
@hohwille hohwille added bug Something isn't working scripts related to shell scripts (bash and CMD) commandlet related to commandlets (scripts/command/*) javascript related to JavaScript tooling (node, npm, ng, etc.) labels Jul 7, 2020
@hohwille hohwille mentioned this issue Jul 9, 2020
@hohwille
Copy link
Member Author

So to figure out if the package.json file actually contains a build script, I came up with this (ugly) bash pipe:

cat package.json | tr '\n' '§' | tr -d '\r' | grep -o "[\"']scripts[\"']\s*:\s*{\s*§.*[\"']build[\"']\s*:"

As we need support on all OS, we can not expect grep to support options like -z or -P.
I know we should avoid such ugly pipes as discussed in #358 but in this case:

  • it is only called in this very specific situation (so performance is not really an issue)
  • I do not see any alternative (except assuming that there is a build script included in package.json but that may not always be the case).

@hohwille hohwille changed the title devon build command not working correct for yarn devon build command not working correct for yarn or npm Aug 24, 2020
@hohwille hohwille linked a pull request Aug 24, 2020 that will close this issue
hohwille added a commit that referenced this issue Aug 27, 2020
* fixed doDevonCommand to pass also debug option
@hohwille hohwille added this to the release:2020.08.001 milestone Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working commandlet related to commandlets (scripts/command/*) javascript related to JavaScript tooling (node, npm, ng, etc.) scripts related to shell scripts (bash and CMD)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant