mirror of
https://github.com/android-actions/setup-android
synced 2024-11-22 05:29:34 -08:00
Format file to match correct "desired" width. Remove leftover debug printout
This commit is contained in:
parent
8023252681
commit
449627e76b
2 changed files with 22 additions and 6 deletions
1
dist/index.js
vendored
1
dist/index.js
vendored
|
@ -6689,7 +6689,6 @@ function installSdkManager() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!fs.existsSync(sdkManagerExe)) {
|
if (!fs.existsSync(sdkManagerExe)) {
|
||||||
core.info('Preinstalled sdkmanager not found.');
|
|
||||||
let cmdlineToolsURL;
|
let cmdlineToolsURL;
|
||||||
if (process.platform === 'linux') {
|
if (process.platform === 'linux') {
|
||||||
cmdlineToolsURL = COMMANDLINE_TOOLS_LIN_URL;
|
cmdlineToolsURL = COMMANDLINE_TOOLS_LIN_URL;
|
||||||
|
|
27
src/main.ts
27
src/main.ts
|
@ -46,13 +46,28 @@ async function callSdkManager(sdkManager: string, arg: string): Promise<void> {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function installSdkManager(): Promise<string> {
|
async function installSdkManager(): Promise<string> {
|
||||||
const cmdlineTools = path.join(ANDROID_SDK_ROOT, 'cmdline-tools', VERSION_SHORT)
|
const cmdlineTools = path.join(
|
||||||
|
ANDROID_SDK_ROOT,
|
||||||
|
'cmdline-tools',
|
||||||
|
VERSION_SHORT
|
||||||
|
)
|
||||||
let sdkManagerExe = path.join(cmdlineTools, 'bin', 'sdkmanager')
|
let sdkManagerExe = path.join(cmdlineTools, 'bin', 'sdkmanager')
|
||||||
|
|
||||||
if (!fs.existsSync(sdkManagerExe)) {
|
if (!fs.existsSync(sdkManagerExe)) {
|
||||||
const latestCmdlineTools = path.join(ANDROID_SDK_ROOT, 'cmdline-tools', 'latest')
|
const latestCmdlineTools = path.join(
|
||||||
const sourcePropertiesFile = path.join(latestCmdlineTools, 'source.properties')
|
ANDROID_SDK_ROOT,
|
||||||
const latestSdkManagerExe = path.join(latestCmdlineTools, 'bin', 'sdkmanager')
|
'cmdline-tools',
|
||||||
|
'latest'
|
||||||
|
)
|
||||||
|
const sourcePropertiesFile = path.join(
|
||||||
|
latestCmdlineTools,
|
||||||
|
'source.properties'
|
||||||
|
)
|
||||||
|
const latestSdkManagerExe = path.join(
|
||||||
|
latestCmdlineTools,
|
||||||
|
'bin',
|
||||||
|
'sdkmanager'
|
||||||
|
)
|
||||||
if (
|
if (
|
||||||
fs.existsSync(latestCmdlineTools) &&
|
fs.existsSync(latestCmdlineTools) &&
|
||||||
fs.existsSync(sourcePropertiesFile) &&
|
fs.existsSync(sourcePropertiesFile) &&
|
||||||
|
@ -100,7 +115,9 @@ async function installSdkManager(): Promise<string> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// touch $ANDROID_SDK_ROOT/repositories.cfg
|
// touch $ANDROID_SDK_ROOT/repositories.cfg
|
||||||
fs.closeSync(fs.openSync(path.join(ANDROID_SDK_ROOT, 'repositories.cfg'), 'w'))
|
fs.closeSync(
|
||||||
|
fs.openSync(path.join(ANDROID_SDK_ROOT, 'repositories.cfg'), 'w')
|
||||||
|
)
|
||||||
core.debug(`sdkmanager available at: ${sdkManagerExe}`)
|
core.debug(`sdkmanager available at: ${sdkManagerExe}`)
|
||||||
return sdkManagerExe
|
return sdkManagerExe
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue