Implement versioning strategies in js 🧉

This commit is contained in:
Webber
2020-04-26 20:22:09 +02:00
committed by Webber Takken
parent 2e81e61af3
commit d75d7890d0
23 changed files with 361 additions and 93 deletions

26
src/model/system.js Normal file
View File

@@ -0,0 +1,26 @@
import { exec } from '@actions/exec';
class System {
static async run(command, arguments_, options) {
let result = '';
let error = '';
const listeners = {
stdout: dataBuffer => {
result += dataBuffer.toString();
},
stderr: dataBuffer => {
error += dataBuffer.toString();
},
};
const exitCode = await exec(command, arguments_, { ...options, listeners });
if (exitCode !== 0) {
throw new Error(error);
}
return result;
}
}
export default System;