Sharing my workaround for failing sdfcli using lin...
# sdf
l
Sharing my workaround for failing sdfcli using linux/ubuntu + workaround to node_modules
I added this export path, and this function export SDFSDK_PATH="/home/nsuser/apps/SDF/2018.2.1" sdfcli() { if [ -d "node_modules" ]; then echo "Moving node_modules to .node_modules" mv node_modules .node_modules fi args=(${@// /\\ }); mvn -f $SDFSDK_PATH/pom.xml exec:java -Dexec.args="${args[*]}" if [ -d ".node_modules" ]; then echo "Moving .node_modules to node_modules" mv .node_modules node_modules fi }
1
I am not using the sdfcli file that comes from sdfcli-supplemental_18_2.tar.gz
Instead of playing with yarn/npm node_modules path, which still break some references, I simply hide it for the time of sdfcli execution.
@chris this might interest you
Even if I ctrl+c the execution of mvn/sdfcli, the function still execute to move back node_modules 😄
the args parts is to escape spaces, so the function call is completely transparent and sdfcli deploy etc works fine
e
Good work
c
awesome
@mkeaton
maybe i could add this to my githooks to change the folder name before push to my repo
m
That’s clever. I wonder if we could do something similar in the plugin. 🤔
a
We are working in a couple of things at the plugin level that will help here: - Respect deploy.xml to create the zip file (in Eclipse, Webstorm and SDFCLI). Only add directories listed in deploy.xml (FileCabinet, Objects, etc) - In the new Node CLI, there will be the option to define l a working directory at project leve (like "/dist"), Also the ability add custom JS code using Node to be executed before/after any command. That way you can add your custom code to run before "sdf deploy" so you can do any operation you want in your code (like transpiling from TS to JS) and then moving the code that you want to push to the working directory. This approach will also help you run any unit tests before deploying
I'm really interested in your feedback here, let me know if this would address your concerns
l
@jonallenaz maybe the code above can help you, it works on mac, put it in /home/{youruser}/.bash_profile