djLint/bin/install.js
Christopher Pickering 4c0caccdf6
feat(npm): updated npm installer
Updated release so npm package will be deployed.

closes #192
2022-07-06 11:24:45 -05:00

21 lines
446 B
JavaScript
Executable file

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);
}