diff --git a/README.md b/README.md index 1f6cc907..e2294f10 100644 --- a/README.md +++ b/README.md @@ -112,12 +112,13 @@ jobs: | Name | Description | Type | | ------------- | -------------------------------------------- | ------ | | `ghc-path` | The path of the ghc executable _directory_ | string | -| `cabal-path` | The path of the cabal executable _directory_ | string | -| `stack-path` | The path of the stack executable _directory_ | string | -| `cabal-store` | The path to the cabal store | string | | `ghc-exe` | The path of the ghc _executable_ | string | +| `cabal-path` | The path of the cabal executable _directory_ | string | | `cabal-exe` | The path of the cabal _executable_ | string | +| `cabal-store` | The path to the cabal store | string | +| `stack-path` | The path of the stack executable _directory_ | string | | `stack-exe` | The path of the stack _executable_ | string | +| `stack-root` | The path to the stack root | string | ## Version Support diff --git a/action.yml b/action.yml index 6d51148a..bc8277e9 100644 --- a/action.yml +++ b/action.yml @@ -26,18 +26,20 @@ inputs: outputs: ghc-path: description: 'The path of the ghc executable _directory_' - cabal-path: - description: 'The path of the cabal executable _directory_' - stack-path: - description: 'The path of the stack executable _directory_' - cabal-store: - description: 'The path to the cabal store' ghc-exe: description: 'The path of the ghc _executable_' + cabal-path: + description: 'The path of the cabal executable _directory_' cabal-exe: description: 'The path of the cabal _executable_' + cabal-store: + description: 'The path to the cabal store' + stack-path: + description: 'The path of the stack executable _directory_' stack-exe: description: 'The path of the stack _executable_' + stack-root: + description: 'The path to the stack root' runs: using: 'node12' main: 'dist/index.js' diff --git a/dist/action.yml b/dist/action.yml index 6d51148a..bc8277e9 100644 --- a/dist/action.yml +++ b/dist/action.yml @@ -26,18 +26,20 @@ inputs: outputs: ghc-path: description: 'The path of the ghc executable _directory_' - cabal-path: - description: 'The path of the cabal executable _directory_' - stack-path: - description: 'The path of the stack executable _directory_' - cabal-store: - description: 'The path to the cabal store' ghc-exe: description: 'The path of the ghc _executable_' + cabal-path: + description: 'The path of the cabal executable _directory_' cabal-exe: description: 'The path of the cabal _executable_' + cabal-store: + description: 'The path to the cabal store' + stack-path: + description: 'The path of the stack executable _directory_' stack-exe: description: 'The path of the stack _executable_' + stack-root: + description: 'The path to the stack root' runs: using: 'node12' main: 'dist/index.js' diff --git a/dist/index.js b/dist/index.js index 4f015b2b..f4d6403c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -8728,7 +8728,15 @@ async function cabalConfig() { for (const [t, { resolved }] of Object.entries(opts).filter(o => o[1].enable)) await core.group(`Installing ${t} version ${resolved}`, async () => installer_1.installTool(t, resolved, process.platform)); if (opts.stack.setup) - await core.group('Pre-installing GHC with stack', async () => exec_1.exec('stack', ['setup', opts.ghc.resolved])); + await core.group('Pre-installing GHC with stack', async () => { + await exec_1.exec('stack', ['setup', opts.ghc.resolved]); + if (process.platform === 'win32') { + core.setOutput('stack-root', 'C:\\sr'); + } + else { + core.setOutput('stack-root', `${process.env.HOME}/.stack`); + } + }); if (opts.cabal.enable) await core.group('Setting up cabal', async () => { await exec_1.exec('cabal', ['user-config', 'update'], { silent: true }); diff --git a/src/setup-haskell.ts b/src/setup-haskell.ts index 591ae586..e26e4fdf 100644 --- a/src/setup-haskell.ts +++ b/src/setup-haskell.ts @@ -26,9 +26,15 @@ async function cabalConfig(): Promise { ); if (opts.stack.setup) - await core.group('Pre-installing GHC with stack', async () => - exec('stack', ['setup', opts.ghc.resolved]) - ); + await core.group('Pre-installing GHC with stack', async () => { + await exec('stack', ['setup', opts.ghc.resolved]); + + if (process.platform === 'win32') { + core.setOutput('stack-root', 'C:\\sr'); + } else { + core.setOutput('stack-root', `${process.env.HOME}/.stack`); + } + }); if (opts.cabal.enable) await core.group('Setting up cabal', async () => {