-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from Cyberbeni/macos-improvement
only use architecture for uuid on macOS
- Loading branch information
Showing
15 changed files
with
96 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,5 @@ jobs: | |
- name: Ensure Built | ||
run: | | ||
make build | ||
git status | ||
[[ -z $(git status --porcelain) ]] || exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
import * as os from 'os' | ||
import * as semver from 'semver' | ||
|
||
import { exec } from '../src/helpers' | ||
|
||
const url = 'https://github.com/realm/SwiftLint' | ||
// const url = 'https://github.com/realm/SwiftLint' | ||
|
||
test('Get versions', async() => { | ||
let versionsString = await exec('git', ['ls-remote', '--refs', '--tags', url]) | ||
let versions = versionsString.split('\n').map(function(value) { | ||
return value.split('/').pop() ?? '' | ||
}) | ||
let targetVersion = semver.maxSatisfying(versions, '^0') | ||
console.log(versions) | ||
console.log(targetVersion) | ||
}) | ||
|
||
test('Get commit hash', async() => { | ||
let resp = await exec('git', ['ls-remote', url, `HEAD`]) | ||
let commitHash = resp.substring(0,40) | ||
console.log(resp) | ||
console.log(commitHash) | ||
test('Local test', async() => { | ||
const osVersion = `${os.type()}-${os.release()}` | ||
console.log(osVersion) | ||
const swiftVersion = await exec('swift', ['-version']) | ||
let additionalInfo = `${osVersion}-${swiftVersion}` | ||
if (os.platform() == "darwin") { | ||
let macVersion = await exec('sw_vers', ['-productVersion']) | ||
if (semver.gte(macVersion, "10.14.4")) { | ||
additionalInfo = `macos-${os.arch()}` | ||
} | ||
} | ||
console.log(additionalInfo) | ||
}) |
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export declare function exec(commandLine: string, args?: string[]): Promise<string>; | ||
export declare function getUuid(url: string, commitHash: string): Promise<string>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,23 @@ | ||
export declare class SwiftToolInstaller { | ||
readonly url: string; | ||
branch: string; | ||
readonly version: string; | ||
readonly useCache: boolean; | ||
private constructor(); | ||
resolveVersion(): Promise<void>; | ||
uuid: string; | ||
cacheKey: string; | ||
workingDirectory: string; | ||
productDirectory: string; | ||
cacheDirectory: string; | ||
updateDirectoryNames(newUuid: string): void; | ||
createWorkingDirectory(): Promise<void>; | ||
didRestore: boolean; | ||
tryToRestore(): Promise<void>; | ||
cloneGit(): Promise<void>; | ||
buildTool(): Promise<void>; | ||
tryToCache(): Promise<void>; | ||
exportPath(): Promise<void>; | ||
install(): Promise<void>; | ||
static install(url: string, branch: string, version: string, useCache: boolean): Promise<void>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters