Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Proper File Separator for OS #459

Merged
merged 3 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 24 additions & 14 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,30 @@ async function run(): Promise<void> {
if (installNative) {
const ktNativePath = await tc.downloadTool(nativeDownloadUrl(version))
core.debug(`Downloaded Kotlin Native ${version} to ${ktNativePath}`)
core.exportVariable('KOTLIN_NATIVE_HOME', ktNativePath)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how this is related to the pr.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's removing a duplicate statement. It does the same thing already below. I just forgot to include that in the description.


const ktNativePathExtractedFolder = await extractNativeArchive(ktNativePath)
nativeCachedPath = await tc.cacheDir(ktNativePathExtractedFolder, 'kotlin-native', version)
}
}
}

const s = IS_WINDOWS ? '\\' : '/'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most likely.


/*
The order of addPath call here matter because both archives have a "kotlinc" binary.
*/
if (installNative) {
const nativePath = `${nativeCachedPath}/kotlin-native-prebuilt-${osName()}-${osArch()}-${version}`
core.addPath(`${nativePath}/bin`)
const nativePath = `${nativeCachedPath}${s}kotlin-native-prebuilt-${osName()}-${osArch()}-${version}`
core.addPath(`${nativePath}${s}bin`)
core.exportVariable('KOTLIN_NATIVE_HOME', nativePath)
core.debug(`Added ${nativePath}/bin to PATH`)
core.debug(`Added ${nativePath}${s}bin to PATH`)
await exec.exec('kotlinc-native', ['-version'])
}

const kotlinPath = `${cachedPath}/kotlinc`
core.addPath(`${kotlinPath}/bin`)
const kotlinPath = `${cachedPath}${s}kotlinc`
core.addPath(`${kotlinPath}${s}bin`)
core.exportVariable('KOTLIN_HOME', kotlinPath)
core.debug(`Added ${kotlinPath}/bin to PATH`)
core.debug(`Added ${kotlinPath}${s}bin to PATH`)
await exec.exec('kotlinc', ['-version'])

const script = core.getInput('script')
Expand Down
Loading