Skip to content

Commit

Permalink
Format file to match correct "desired" width. Remove leftover debug p…
Browse files Browse the repository at this point in the history
…rintout
  • Loading branch information
ViliusSutkus89 committed Nov 21, 2023
1 parent 8023252 commit 449627e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
1 change: 0 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6689,7 +6689,6 @@ function installSdkManager() {
}
}
if (!fs.existsSync(sdkManagerExe)) {
core.info('Preinstalled sdkmanager not found.');
let cmdlineToolsURL;
if (process.platform === 'linux') {
cmdlineToolsURL = COMMANDLINE_TOOLS_LIN_URL;
Expand Down
27 changes: 22 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,28 @@ async function callSdkManager(sdkManager: string, arg: string): Promise<void> {
}

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')

if (!fs.existsSync(sdkManagerExe)) {
const latestCmdlineTools = path.join(ANDROID_SDK_ROOT, 'cmdline-tools', 'latest')
const sourcePropertiesFile = path.join(latestCmdlineTools, 'source.properties')
const latestSdkManagerExe = path.join(latestCmdlineTools, 'bin', 'sdkmanager')
const latestCmdlineTools = path.join(
ANDROID_SDK_ROOT,
'cmdline-tools',
'latest'
)
const sourcePropertiesFile = path.join(
latestCmdlineTools,
'source.properties'
)
const latestSdkManagerExe = path.join(
latestCmdlineTools,
'bin',
'sdkmanager'
)
if (
fs.existsSync(latestCmdlineTools) &&
fs.existsSync(sourcePropertiesFile) &&
Expand Down Expand Up @@ -100,7 +115,9 @@ async function installSdkManager(): Promise<string> {
}

// 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}`)
return sdkManagerExe
}
Expand Down

0 comments on commit 449627e

Please sign in to comment.