Skip to content

Commit

Permalink
option: no spcomp proxy (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
rumblefrog authored Jul 14, 2022
1 parent 7efa536 commit 434d319
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ inputs:
description: 'Name of the define for the version of the plugin if you are using one'
required: false
default: ''
no-spcomp-proxy:
description: 'Whether spcomp should not be proxied to fix relative include path'
required: false
default: 'false'
outputs:
version:
description: 'Version of the SP compiler used'
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/installer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { find as findCache, downloadTool, extractTar, extractZip, cacheDir } from '@actions/tool-cache';
import { addPath, exportVariable } from '@actions/core';
import { addPath, exportVariable, getBooleanInput } from '@actions/core';
import { maxSatisfying } from 'semver';
import { existsSync } from 'fs';
import { rename, writeFile } from 'fs/promises';
Expand Down Expand Up @@ -28,6 +28,10 @@ export async function installCompiler(range: string): Promise<string> {
// Workaround for https://github.com/rumblefrog/setup-sp/issues/5
// We use a proxy script to call the original spcomp64 and include the path to the compiler
if (
!(
getBooleanInput('no-spcomp-proxy', { required: false })
|| process.env.NO_SPCOMP_PROXY
) &&
process.platform == 'linux' && !existsSync(pathJoin(cache, 'spcomp64_original'))
) {
await rename(pathJoin(cache, 'spcomp64'), pathJoin(cache, 'spcomp64_original'));
Expand Down

0 comments on commit 434d319

Please sign in to comment.