-
Notifications
You must be signed in to change notification settings - Fork 6
/
pip_ssc.ado
97 lines (76 loc) · 2.43 KB
/
pip_ssc.ado
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*==================================================
project: message to the user if file is installed from SSC
Author: R.Andres Castaneda
E-email: [email protected]
url:
Dependencies: The World Bank
----------------------------------------------------
Creation Date: 6 Oct 2022 - 16:08:28
Modification Date:
Do-file version: 01
References:
Output:
==================================================*/
/*==================================================
0: Program set up
==================================================*/
program define pip_ssc, rclass
version 16.1
syntax [anything(name=subcommand)] ///
[, ///
pause ///
]
if ("`pause'" == "pause") pause on
else pause off
/*==================================================
1: Update
==================================================*/
if ("`subcommand'" == "update") {
qui adoupdate pip, ssconly
if ("`r(pkglist)'" == "pip") {
cap window stopbox rusure "There is a new version of pip in SSC." ///
"Would you like to install it now?"
if (_rc == 0) {
cap ado update pip, ssconly update
if (_rc == 0) {
cap window stopbox note "Installation complete. please type" ///
"discard in your command window to finish"
local bye "exit"
}
else {
noi disp as err "there was an error in the installation. " _n ///
"please run the following to retry, " _n(2) ///
"{stata ado update pip, ssconly update}"
local bye "error"
}
}
else local bye ""
} // end of checking SSC update
else {
noi disp as result "SSC version of {cmd:pip} is up to date."
local bye ""
}
return local bye = "`bye'"
}
/*==================================================
2: Message
==================================================*/
if (inlist("`subcommand'", "msg", "message")) {
noi disp "You're using SSC as the host of the {cmd:pip} Stata package."
noi disp "If you want to install the GitHub version type {stata pip_install gh}"
}
//========================================================
// Install
//========================================================
if (inlist("`subcommand'", "install")) {
pip_install ssc, replace
}
end
exit
/* End of do-file */
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
Notes:
1.
2.
3.
Version Control: