Skip to content

Commit

Permalink
update wget command
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieBriersSageCom committed Mar 22, 2021
1 parent 4083257 commit a80e166
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ try {
core.setFailed(error.message)
}

function installPMD(version){
var download = `wget https://github.com/pmd/pmd/releases/download/pmd_releases%2F${version}/pmd-bin-${version}.zip -P /tmp -O pmd.zip`
function installPMD(version) {
var download = `wget https://github.com/pmd/pmd/releases/download/pmd_releases%2F${version}/pmd-bin-${version}.zip -O /tmp/pmd.zip`
var unzip = 'unzip /tmp/pmd.zip -d /tmp'
var mk = 'mkdir $HOME/pmd'
var mv = 'mv /tmp/pmd/* $HOME/pmd'
exec(download+' && '+unzip+' && '+mk+' && '+mv, function(error, stdout, stderr){
if(error) core.setFailed(stderr)
exec(download + ' && ' + unzip + ' && ' + mk + ' && ' + mv, function (error, stdout, stderr) {
if (error) core.setFailed(stderr)
core.debug(stdout)
referencePMD()
})
}

function referencePMD(){
function referencePMD() {
var mk = 'sudo mkdir -p /snap/bin && sudo chmod -R 757 /snap/bin'
var cmd =
`sudo echo '#! /bin/bash
var cmd =
`sudo echo '#! /bin/bash
$HOME/pmd/bin/run.sh pmd "$@"' > /snap/bin/pmd`
var cm = 'chmod +x /snap/bin/pmd'
exec(mk+' && '+cmd+' && '+cm, function(error, stdout, stderr){
if(error) core.setFailed(stderr)
exec(mk + ' && ' + cmd + ' && ' + cm, function (error, stdout, stderr) {
if (error) core.setFailed(stderr)
core.debug(stdout)
})
}
Expand Down
18 changes: 9 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ try {
core.setFailed(error.message)
}

function installPMD(version){
var download = `wget https://github.com/pmd/pmd/releases/download/pmd_releases%2F${version}/pmd-bin-${version}.zip -P /tmp -O pmd.zip`
function installPMD(version) {
var download = `wget https://github.com/pmd/pmd/releases/download/pmd_releases%2F${version}/pmd-bin-${version}.zip -O /tmp/pmd.zip`
var unzip = 'unzip /tmp/pmd.zip -d /tmp'
var mk = 'mkdir $HOME/pmd'
var mv = 'mv /tmp/pmd/* $HOME/pmd'
exec(download+' && '+unzip+' && '+mk+' && '+mv, function(error, stdout, stderr){
if(error) core.setFailed(stderr)
exec(download + ' && ' + unzip + ' && ' + mk + ' && ' + mv, function (error, stdout, stderr) {
if (error) core.setFailed(stderr)
core.debug(stdout)
referencePMD()
})
}

function referencePMD(){
function referencePMD() {
var mk = 'sudo mkdir -p /snap/bin && sudo chmod -R 757 /snap/bin'
var cmd =
`sudo echo '#! /bin/bash
var cmd =
`sudo echo '#! /bin/bash
$HOME/pmd/bin/run.sh pmd "$@"' > /snap/bin/pmd`
var cm = 'chmod +x /snap/bin/pmd'
exec(mk+' && '+cmd+' && '+cm, function(error, stdout, stderr){
if(error) core.setFailed(stderr)
exec(mk + ' && ' + cmd + ' && ' + cm, function (error, stdout, stderr) {
if (error) core.setFailed(stderr)
core.debug(stdout)
})
}

0 comments on commit a80e166

Please sign in to comment.