Skip to content
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
2 changes: 1 addition & 1 deletion .github/utils/update_metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export async function currentData(): Promise<SwiftorgMetadata> {
res.on('end', () => {
try {
const parsedData = JSON.parse(rawData) as SwiftorgMetadata
core.debug(`Recieved swift.org metadata: "${rawData}"`)
core.debug(`Received swift.org metadata: "${rawData}"`)
resolve(parsedData)
} catch (e) {
core.error(`Parsing swift.org metadata error: '${e}'`)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ _See also: [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md)_

## Submitting Pull Requests

You can contribute by fixing bugs or adding new features, you can go through out [GitHub issues](https://github.com/SwiftyLab/setup-swift/issues) to start contributing. For larger code changes, we first recommend discussing them in our [GitHub dicussions](https://github.com/SwiftyLab/setup-swift/discussions). When submitting a pull request, please do the followings:
You can contribute by fixing bugs or adding new features, you can go through out [GitHub issues](https://github.com/SwiftyLab/setup-swift/issues) to start contributing. For larger code changes, we first recommend discussing them in our [GitHub discussions](https://github.com/SwiftyLab/setup-swift/discussions). When submitting a pull request, please do the followings:

1. Apply standard formatting with `npm run format`, and verify added code with lint rules by `npm run lint`.
1. Add relevant tests and ensure your changes don't break any existing tests (see [Automated Tests](#automated-tests) below).
Expand Down
2,886 changes: 2,308 additions & 578 deletions dist/index.js

Large diffs are not rendered by default.

25 changes: 0 additions & 25 deletions package-lock.json

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

12 changes: 7 additions & 5 deletions src/installer/windows/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ export class WindowsToolchainInstaller extends VerifyingToolchainInstaller<Windo
: '10.0.17763'
const current = os.release()
let version = semver.gte(current, recommended) ? current : recommended
const insatlled = await this.insatlledSdks()
if (insatlled.length && !insatlled.includes(version)) {
version = insatlled[0]
const installed = await this.installedSdks()
if (installed.length && !installed.includes(version)) {
version = installed[0]
}

const major = semver.lt(version, win11Semver) ? semver.major(version) : 11
const minor = semver.patch(version)
return `Microsoft.VisualStudio.Component.Windows${major}SDK.${minor}`
}

private async insatlledSdks() {
private async installedSdks() {
const sdksPath = path.join(program86(), 'Windows Kits', '10', 'Include')
try {
const dirs = await fs.readdir(sdksPath, {withFileTypes: true})
Expand Down Expand Up @@ -152,7 +152,9 @@ export class WindowsToolchainInstaller extends VerifyingToolchainInstaller<Windo
}

if (!sdkroot) {
core.warning(`Failed VS enviroment after installation ${installLocation}`)
core.warning(
`Failed VS environment after installation ${installLocation}`
)
return
}

Expand Down
2 changes: 1 addition & 1 deletion src/installer/windows/installation/fallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export async function fallback(
oldEnv: Record<string, string>,
newEnv: Record<string, string>
) {
core.warning('Procceding with fallback installation approach')
core.warning('Proceeding with fallback installation approach')
const data = Object.entries(newEnv).reduce(
(previous, current) => {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/installer/windows/modules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export async function updateSdkModules(sdkRoot: string): Promise<void> {
})

res.on('end', () => {
core.debug(`Recieved ${name} module definition: "${rawData}"`)
core.debug(`Received ${name} module definition: "${rawData}"`)
resolve(rawData)
})
})
Expand Down
2 changes: 1 addition & 1 deletion src/swiftorg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class Swiftorg {
res.on('end', () => {
try {
const parsedData = JSON.parse(rawData)
core.debug(`Recieved swift.org metadata: "${rawData}"`)
core.debug(`Received swift.org metadata: "${rawData}"`)
Swiftorg.commitFromMetadata(parsedData).then(
commit => resolve({commit}),
e => reject(e)
Expand Down
Loading