-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrmworkspace.sh
executable file
·43 lines (38 loc) · 1.12 KB
/
rmworkspace.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
#===============================================================================
#
# FILE: rmworkspace.sh
#
# USAGE: ./rmworkspace.sh
#
# DESCRIPTION: Remove files relating to an Eclipse workspace
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Matt Coffey (),
# COMPANY:
# VERSION: 1.0
# CREATED: 11/10/14 19:50:04 GMT
# REVISION: ---
#===============================================================================
while getopts w: option
do
case "${option}"
in
w) WORKSPACE=${OPTARG};;
esac
done
# Exit if the argument is absent
if [[ -z $WORKSPACE || 'template' == $WORKSPACE || 's' == $WORKSPACE ]] ; then
echo "Invocation rmworkspace.sh -w [workspace]"
echo "[workspace] can't be 'template' or 's'"
exit 1;
fi
BASE_PATH="$HOME/workspaces"
WORKSPACE_PATH="$BASE_PATH/$WORKSPACE"
BASH_PATH="$BASE_PATH/s/$WORKSPACE.sh"
APPLE_PATH="$BASE_PATH/s/$WORKSPACE.scpt"
rm -rf "$WORKSPACE_PATH" "$BASH_PATH" "$APPLE_PATH"
echo "Removed workspace $WORKSPACE"