Removed 'ideenv' script as it is available in bootstrap packages

This commit is contained in:
Akash Yadav
2022-10-29 18:30:12 +05:30
parent 0ddfae78d9
commit 8bbdaffd79
2 changed files with 5 additions and 45 deletions
-33
View File
@@ -1,33 +0,0 @@
#!/bin/bash
set -eu
print_help() {
echo "Utility command to show/edit AndroidIDE Environment Variables"
echo "Usage: ideenv [options]"
echo ""
echo " -s Show the environment variables"
echo " -e Edit the environment variables"
echo ""
}
PROPS=@PREFIX@/etc/ide-environment.properties
while getopts ":she" option; do
case $option in
s) ## Simply print the contents of the file
if [ ! -f "$PROPS" ]; then
echo "Properties file does not exist."
exit 1
fi
cat $PROPS
echo ""
exit;;
h) ## Show the help
print_help
exit;;
e) ## Open the file in nano editor
echo "Opening $PROPS file with nano editor..."
nano $PROPS
exit;;
esac
done
@@ -60,8 +60,9 @@ public class ToolsManager {
extractGradlePlugin();
extractToolingApi();
extractAndroidJar();
extractIdeEnv();
writeInitScript();
deleteIdeenv();
})
.whenComplete(
(__, error) -> {
@@ -95,18 +96,10 @@ public class ToolsManager {
}
}
private static void extractIdeEnv() {
private static void deleteIdeenv() {
final var file = new File(Environment.BIN_DIR, "ideenv");
if (file.exists()) {
file.delete();
}
var contents = ResourceUtils.readAssets2String(getCommonAsset("ideenv"));
contents = contents.replace("@PREFIX@", Environment.PREFIX.getAbsolutePath());
FileIOUtils.writeFileFromString(file, contents);
if (!file.canExecute()) {
file.setExecutable(true);
if (file.exists() && !file.delete()) {
LOG.warn("Unable to delete", file);
}
}