-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpip_update.ado
84 lines (63 loc) · 1.8 KB
/
pip_update.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
/*==================================================
project: update pip depending on source
Author: R.Andres Castaneda
E-email: [email protected]
url:
Dependencies: The World Bank
----------------------------------------------------
Creation Date: 13 Feb 2023 - 19:35:59
Modification Date:
Do-file version: 01
References:
Output:
==================================================*/
/*==================================================
0: Program set up
==================================================*/
program define pip_update, rclass
syntax [anything(name=src)] ///
[, ///
username(string) ///
cmd(string) ///
version(string) ///
pause ///
replace ///
path(string) ///
]
version 16.1
/*==================================================
set up
==================================================*/
if ("`pause'" == "pause") pause on
else pause off
if ("`cmd'" == "") {
local cmd pip
}
if ("`username'" == "") {
local username "worldbank"
}
//========================================================
// Update
//========================================================
pip_find_src , path(`path')
local src = "`r(src)'"
return add
//------------ If PIP was installed from github
if ("`src'" == "gh") {
pip_gh update, username(`username') cmd(`cmd') `pause'
return add
} // end if installed from github
//------------ if pip was installed from SSC
else {
pip_ssc update, `pause'
return add
} // Finish checking pip update
end
exit
/* End of do-file */
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
Notes:
1.
2.
3.
Version Control: