bitfocus/companion-module-behringer-x32

Yarn build command fails in WSL 2 because of 'trash' command

hjoelr opened this issue · 7 comments

"build": "trash dist && yarn build:main",

I'm using WSL 2 as my Linux environment and the trash dist part of the build command keeps failing.

image

I was wondering if it would be okay to change the build command to the following?

"build": "rm -r dist && yarn build:main"

This would work more universally.

Could you create a pull request for that? Seems like a good suggestion, but this way we can track and review better

I wouldn't go with rm -r because for anyone running on windows not via wsl that will fail. I would try using rimraf or some other npm package to do the delete

@JeffreyDavidsz @Julusian Okay, I didn't realize the trash command was most likely using the NPM trash utility. I was wondering how it even did anything as I didn't have a native trash command in WSL 2.

To be fair, this isn't really a bug with this (and a few other Companion) plugins. It really appears to be a bug in the NPM trash utility and/or Docker (which I used for other projects). @Julusian, good point about being cross-platform. Substituting trash for rimraf seems to work in WSL 2. I can submit a PR for this.

Im not sure its worth the effort for you to create a pr. I think there is ~5 modules which will need updating then merging into companion, so itll be quicker for me to do it for them all at once.
Ill try and do that this evening, but I might not get to it

That would be great! Thank you. I've currently worked around the issue in my dev environment by preemptively deleting the dist folders before calling the update.sh utility. However, not having to do that step would be great too :).

@hjoelr I have gone through and replaced trash with rimraf in all of the modules that were using it. Hopefully this works for you now :)

@Julusian Thank you!