Skip to content

Commit

Permalink
experimental: add 'msys.cmd' to support multi-line run steps
Browse files Browse the repository at this point in the history
  • Loading branch information
1138-4EB authored and eine committed Dec 13, 2019
1 parent 3434e1a commit 8fa3c6c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,19 @@ jobs:
env:
MSYSTEM: MINGW32

shell:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: install deps
run: npm ci
- name: run action
uses: ./
- shell: ./msys2.cmd {0}
run: |
uname -a
pacman -Syu --noconfirm
msystem:
strategy:
matrix:
Expand Down
14 changes: 11 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,20 @@ async function run() {

let cmd = path.join(dest, 'msys2do.cmd');
fs.writeFileSync(cmd, [
'setlocal',
'@echo off',
'IF NOT DEFINED MSYS2_PATH_TYPE set MSYS2_PATH_TYPE=' + core.getInput('path-type'),
`setlocal`,
`@echo off`,
`IF NOT DEFINED MSYS2_PATH_TYPE set MSYS2_PATH_TYPE=` + core.getInput('path-type'),
`%~dp0\\msys64\\usr\\bin\\bash.exe -ilc "cd $OLDPWD && %*"`
].join('\r\n'));

fs.writeFileSync('C:/hostedtoolcache/windows/Python/3.6.8/x64/msys2.cmd', [
`setlocal`,
`@echo off`,
`set "args=%*"`,
`set "args=%args:\\=/%"`,
cmd + ` %args%`
].join('\r\n'));

core.addPath(dest);

core.exportVariable('MSYSTEM', core.getInput('msystem'));
Expand Down

0 comments on commit 8fa3c6c

Please sign in to comment.