Initial commit

This commit is contained in:
Jonathan Clem
2019-08-28 00:00:01 -04:00
commit 83d6ee76a6
210 changed files with 15020 additions and 0 deletions

36
src/installer.js Normal file
View File

@@ -0,0 +1,36 @@
const {exec} = require('@actions/exec')
const path = require('path')
const semver = require('semver')
module.exports = {installElixir, installOTP}
/**
* Install Elixir.
*
* @param {string} version
* @param {string} arch
*/
async function installElixir(version) {
let arch = 'all'
if (semver.gt('1.9.0', version)) arch = 'amd64'
if (process.platform === 'linux') {
await exec(path.join(__dirname, 'install-elixir-ubuntu'), [version, arch])
}
}
/**
* Install OTP.
*
* @param {string} version
*/
async function installOTP(version) {
if (process.platform === 'linux') {
await exec(path.join(__dirname, 'install-otp-ubuntu'), [version])
return
}
throw new Error(
'@actions/setup-elixir only supports Ubuntu Linux at this time'
)
}