diff options
Diffstat (limited to 'subcmds/gitc_delete.py')
-rw-r--r-- | subcmds/gitc_delete.py | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/subcmds/gitc_delete.py b/subcmds/gitc_delete.py deleted file mode 100644 index ae9d4d1f..00000000 --- a/subcmds/gitc_delete.py +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | # Copyright (C) 2015 The Android Open Source Project | ||
2 | # | ||
3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
4 | # you may not use this file except in compliance with the License. | ||
5 | # You may obtain a copy of the License at | ||
6 | # | ||
7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
8 | # | ||
9 | # Unless required by applicable law or agreed to in writing, software | ||
10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
12 | # See the License for the specific language governing permissions and | ||
13 | # limitations under the License. | ||
14 | |||
15 | import sys | ||
16 | |||
17 | from command import Command, GitcClientCommand | ||
18 | import platform_utils | ||
19 | |||
20 | |||
21 | class GitcDelete(Command, GitcClientCommand): | ||
22 | COMMON = True | ||
23 | visible_everywhere = False | ||
24 | helpSummary = "Delete a GITC Client." | ||
25 | helpUsage = """ | ||
26 | %prog | ||
27 | """ | ||
28 | helpDescription = """ | ||
29 | This subcommand deletes the current GITC client, deleting the GITC manifest | ||
30 | and all locally downloaded sources. | ||
31 | """ | ||
32 | |||
33 | def _Options(self, p): | ||
34 | p.add_option( | ||
35 | "-f", | ||
36 | "--force", | ||
37 | dest="force", | ||
38 | action="store_true", | ||
39 | help="force the deletion (no prompt)", | ||
40 | ) | ||
41 | |||
42 | def Execute(self, opt, args): | ||
43 | if not opt.force: | ||
44 | prompt = ( | ||
45 | "This will delete GITC client: %s\nAre you sure? (yes/no) " | ||
46 | % self.gitc_manifest.gitc_client_name | ||
47 | ) | ||
48 | response = input(prompt).lower() | ||
49 | if not response == "yes": | ||
50 | print('Response was not "yes"\n Exiting...') | ||
51 | sys.exit(1) | ||
52 | platform_utils.rmtree(self.gitc_manifest.gitc_client_dir) | ||