Skip to content

Commit

Permalink
Resolve relative paths to the script
Browse files Browse the repository at this point in the history
  • Loading branch information
csexton committed Oct 2, 2019
1 parent bc0ebef commit 84ab716
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ const core = require('@actions/core');
function run() {
try {
// This is just a thin wrapper around bash
var child = require('child_process').execFile('./script.sh');
const script = require('path').resolve(__dirname, 'script.sh');

console.log(script);
var child = require('child_process').execFile(script);
child.stdout.on('data', function(data) {
console.log(data.toString());
});
Expand Down
6 changes: 4 additions & 2 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

set -e

echo Setting up tmate
echo Setting up tmate...

if [ -x "$(command -v brew)" ]; then
brew install tmate
fi
Expand All @@ -14,7 +15,8 @@ fi
[ -e ~/.ssh/id_rsa ] || ssh-keygen -t rsa -f ~/.ssh/id_rsa -q -N ""


echo Running tmate
echo Running tmate...

tmate -S /tmp/tmate.sock new-session -d
tmate -S /tmp/tmate.sock wait tmate-ready
tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}'
Expand Down

0 comments on commit 84ab716

Please sign in to comment.