Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Update html build script subprocess.call (#132)
Browse files Browse the repository at this point in the history
Why:

* While trying to rebuild the HTML for custom attributes, the
  preBuildHTML.py script was failing when calls were made to
  `subprocess.call`.  Under the hood the `subprocess.call` function
  calls `Popen`.  The following is from the documentation page of the
  subprocess library:

  https://docs.python.org/3/library/subprocess.html#subprocess.Popen
  ```
  If shell is True, it is recommended to pass args as a string rather than as a sequence.
  ```

  While the documentation says that passing a sequence of program
  arguments should work as intended, building on linux and Mac both
  failed when using the sequence and succeeded when using a single
  string.

This change addresses the need by:

* Updating all calls to `subprocess.call` in preBuildHTML.py to use
  single string instead of list as the first argument.
  • Loading branch information
bmanifold authored Dec 27, 2021
1 parent 52baeb9 commit ff983a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/preBuildHTML.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ def preBuildHTMLFun():

if webpackInst == False:
print("Running npm ci...")
call(["npm", "ci"], shell=True)
call("npm ci", shell=True)
print("Running npx browserslist@latest --update-db...")
call(["npx", "browserslist@latest", "--update-db"], shell=True)
call("npx browserslist@latest --update-db", shell=True)

print("Running npm run build...")
call(["npm", "run", "build"], shell=True)
call("npm run build", shell=True)

0 comments on commit ff983a4

Please sign in to comment.