From b6b5410d1928ed8201991b9139f8dac479d3ee8a Mon Sep 17 00:00:00 2001 From: Christopher Pickering Date: Fri, 29 Jul 2022 09:55:33 -0500 Subject: [PATCH] chore(npm): improved npm install process to work on more systems Removed the node install script and just install directly with a node-script. --- bin/install.js | 21 --------------------- package.json | 2 +- 2 files changed, 1 insertion(+), 22 deletions(-) delete mode 100755 bin/install.js diff --git a/bin/install.js b/bin/install.js deleted file mode 100755 index 1908bd7..0000000 --- a/bin/install.js +++ /dev/null @@ -1,21 +0,0 @@ -const { PythonShell } = require('python-shell'); - -PythonShell.defaultOptions = {}; -const options = { - mode: 'text', - args: ['pip', 'install', 'djlint'], - pythonOptions: ['-u'], - env: { PYCHARM_HOSTED: 1 }, -}; - -try { - PythonShell.getVersionSync(); - - PythonShell.run('-m', options, function (error, results) { - if (error) throw error; - console.log(results.join('\n')); - }); -} catch (e) { - console.log(e.message); - process.exit(1); -} diff --git a/package.json b/package.json index bc1e9f7..58fb134 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ }, "scripts": { "format": "prettier --config .prettierrc \"{bin,docs}/**/*.{ts,css,less,scss,js,json,md,yaml,html}\" --write", - "postinstall": "node ./bin/install.js", + "postinstall": "python3 -m pip install --upgrade djlint", "pre-commit": "lint-staged", "commit": "git add . && pre-commit run; npm run pre-commit && cz --no-verify", "test": "xo"