djLint/bin/install.js

22 lines
446 B
JavaScript
Raw Normal View History

const { PythonShell } = require('python-shell');
2022-02-18 23:01:16 +00:00
PythonShell.defaultOptions = {};
const options = {
mode: 'text',
args: ['pip', 'install', 'djlint'],
pythonOptions: ['-u'],
env: { PYCHARM_HOSTED: 1 },
};
2022-02-18 23:01:16 +00:00
try {
PythonShell.getVersionSync();
2022-02-18 23:01:16 +00:00
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);
}