Skip to content

Commit af19478

Browse files
jzbrooksjakubuhlarik
authored andcommitted
Avoid changing the owner of unnecessary files (ReactiveCircus#406)
* Avoid changing the owner of unnecessary files Source files shouldn't matter for the purposes of this tool. % ls -R $ANDROID_HOME/sources/android-34 | wc -l 17750 * Remove non-existant directory * Avoid another unnecessary chown * Push js
1 parent 0b26b60 commit af19478

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/sdk-installer.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ function installAndroidSdk(apiLevel, target, arch, channelId, emulatorBuild, ndk
5353
const isOnMac = process.platform === 'darwin';
5454
const isArm = process.arch === 'arm64';
5555
if (!isOnMac) {
56-
yield exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME} -R`);
56+
yield exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME}/platform-tools -R`);
57+
yield exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME}/cmdline-tools/latest -R`);
58+
yield exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME}/build-tools/${BUILD_TOOLS_VERSION} -R`);
5759
}
5860
const cmdlineToolsPath = `${process.env.ANDROID_HOME}/cmdline-tools`;
5961
if (!fs.existsSync(cmdlineToolsPath)) {

src/sdk-installer.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ export async function installAndroidSdk(apiLevel: string, target: string, arch:
2020
const isArm = process.arch === 'arm64';
2121

2222
if (!isOnMac) {
23-
await exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME} -R`);
23+
await exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME}/platform-tools -R`);
24+
await exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME}/cmdline-tools/latest -R`);
25+
await exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME}/build-tools/${BUILD_TOOLS_VERSION} -R`);
2426
}
2527

2628
const cmdlineToolsPath = `${process.env.ANDROID_HOME}/cmdline-tools`;

0 commit comments

Comments
 (0)