mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
Removed 'ideenv' script as it is available in bootstrap packages
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user