diff --git a/synthtool/languages/node.py b/synthtool/languages/node.py index 9f8da9f87..b928d32b8 100644 --- a/synthtool/languages/node.py +++ b/synthtool/languages/node.py @@ -212,7 +212,8 @@ def fix(hide_output=False): logger.debug("Running fix...") shell.run(["npm", "run", "fix"], hide_output=hide_output) - +#TODO: delete these functions if it turns out we no longer +#need them to be hermetic. def fix_hermetic(hide_output=False): """ Fixes the formatting in the current Node.js library. It assumes that gts @@ -220,13 +221,13 @@ def fix_hermetic(hide_output=False): """ logger.debug("Copy eslint config") shell.run( - ["cp", "-r", "node_modules", "."], + ["cp", "-r", "/node_modules", "."], check=True, hide_output=hide_output, ) logger.debug("Running fix...") shell.run( - ["node_modules/.bin/gts", "fix"], + ["/node_modules/.bin/gts", "fix"], check=False, hide_output=hide_output, ) @@ -240,7 +241,8 @@ def compile_protos(hide_output=False): logger.debug("Compiling protos...") shell.run(["npx", "compileProtos", "src"], hide_output=hide_output) - +#TODO: delete these functions if it turns out we no longer +#need them to be hermetic. def compile_protos_hermetic(hide_output=False): """ Compiles protos into .json, .js, and .d.ts files using @@ -249,7 +251,7 @@ def compile_protos_hermetic(hide_output=False): """ logger.debug("Compiling protos...") shell.run( - ["node_modules/.bin/compileProtos", "src"], + ["/node_modules/.bin/compileProtos", "src"], check=True, hide_output=hide_output, ) @@ -265,8 +267,8 @@ def postprocess_gapic_library(hide_output=False): def postprocess_gapic_library_hermetic(hide_output=False): logger.debug("Post-processing GAPIC library...") - fix_hermetic(hide_output=hide_output) - compile_protos_hermetic(hide_output=hide_output) + fix(hide_output=hide_output) + compile_protos(hide_output=hide_output) logger.debug("Post-processing completed")