Skip to content

Commit

Permalink
add nosudo for linux args
Browse files Browse the repository at this point in the history
  • Loading branch information
jurplel committed Apr 24, 2021
1 parent 5b3bb66 commit b0970a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Default: `$RUNNER_WORKSPACE` (this is one folder above the starting directory)

### `install-deps`
Whether or not to automatically install Qt dependencies on Linux (you probably want to leave this on).
Can be set to `nosudo` to stop it from using sudo, for example on a docker container where the user already has sufficient privileges.

Default: `true`

Expand Down
13 changes: 10 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,16 @@ async function run() {

// Qt installer assumes basic requirements that are not installed by
// default on Ubuntu.
if (process.platform == "linux" && core.getInput("install-deps") == "true") {
await exec.exec("sudo apt-get update")
await exec.exec("sudo apt-get install build-essential libgl1-mesa-dev libxkbcommon-x11-0 libpulse-dev -y")
if (process.platform == "linux") {
let cmd0 = "apt-get update"
let cmd1 = "apt-get install build-essential libgl1-mesa-dev libxkbcommon-x11-0 libpulse-dev -y"
if (core.getInput("install-deps") == "true") {
await exec.exec("sudo " + cmd0)
await exec.exec("sudo " + cmd0)

This comment has been minimized.

Copy link
@firewave

firewave Apr 24, 2021

This needs to be cmd1. Otherwise its totally broken :(

} else if (core.getInput("install-deps") == "nosudo") {
await exec.exec(cmd0)
await exec.exec(cmd1)
}
}

if (core.getInput("cached") != "true") {
Expand Down

0 comments on commit b0970a3

Please sign in to comment.