forked from apache/cordova-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Uninstall Cordova.applescript
64 lines (61 loc) · 2.39 KB
/
Uninstall Cordova.applescript
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
set question to display dialog "Uninstall Cordova?" buttons {"Yes", "No"} default button 2 with icon caution
set answer to button returned of question
if answer is equal to "Yes" then
tell application "Finder" to set home_path to home as text
tell application "Finder" to set startup_hd to startup disk as string
-- delete Xcode 3 Template
set source to (home_path & "Library:Application Support:Developer:Shared:Xcode:Project Templates:Cordova")
tell application "Finder"
if exists folder source then
delete source
end if
end tell
-- delete Xcode 4 Template
set source to (home_path & "Library:Developer:Xcode:Templates:Project Templates:Application:Cordova-based Application.xctemplate")
tell application "Finder"
if exists folder source then
delete source
end if
end tell
-- delete CordovaLib (used by Xcode 3 Template, and generating Cordova.framework if need be)
set source to (home_path & "Documents:CordovaLib")
tell application "Finder"
if exists folder source then
delete source
end if
end tell
-- delete Cordova.framework (used by Xcode 4 Template) and its parent directories
set source to (startup_hd & "Users:Shared:Cordova")
tell application "Finder"
if exists folder source then
delete source
end if
end tell
-- delete symlink to Cordova.framework
set source to (home_path & "Library:Frameworks:Cordova.framework")
tell application "Finder"
if exists file source then
delete source
end if
end tell
-- end
display dialog "Cordova uninstalled." buttons {"Goodbye ☹"} with icon note
else
display dialog "Phew!" buttons {"That was close ☺"} with icon note
end if