4
4
5
5
use SDK \{Config , Exception };
6
6
7
- $ sopt = "s:cuhb:a:d:t:fn " ;
7
+ $ sopt = "s:cuhb:a:d:t:fnp " ;
8
8
$ lopt = array (
9
9
"branch: " ,
10
10
"update " ,
16
16
"deps: " ,
17
17
"force " ,
18
18
"no-backup " ,
19
+ "pack " ,
19
20
);
20
21
21
22
$ cmd = NULL ;
87
88
case "no-backup " :
88
89
$ backup = false ;
89
90
break ;
91
+
92
+ case "p " :
93
+ case "pack " :
94
+ $ cmd = "pack " ;
95
+ break ;
90
96
}
91
97
}
92
98
157
163
$ dm ->performUpdate ($ msg , $ force , $ backup );
158
164
msg ($ msg );
159
165
break ;
166
+ case "pack " :
167
+ $ path_to_pack = Config::getDepsLocalPath ();
168
+ $ pack_path = dirname ($ path_to_pack ) . DIRECTORY_SEPARATOR . "deps- $ branch- $ branch_data [crt]- $ branch_data [arch].7z " ;
169
+ print "Packaging ' $ path_to_pack' as ' $ pack_path'. \n\n" ;
170
+ if ($ force && is_file ($ pack_path )) {
171
+ unlink ($ pack_path );
172
+ }
173
+ `7za a $ pack_path $ path_to_pack `;
174
+ break ;
160
175
}
161
176
162
177
} catch (Throwable $ e ) {
@@ -177,7 +192,8 @@ function usage(int $code = -1)
177
192
echo " -s --stability One of stable or staging. " , PHP_EOL , PHP_EOL ;
178
193
echo "Commands: " , PHP_EOL ;
179
194
echo " -c --check Check for dependency updates. If updates are available, the exit code is set to 7. " , PHP_EOL ;
180
- echo " -u --update Update dependencies. If deps directory already exists, backup copy is created automatically. " , PHP_EOL , PHP_EOL ;
195
+ echo " -u --update Update dependencies. If deps directory already exists, backup copy is created automatically. " , PHP_EOL ;
196
+ echo " -p --pack Archive the dependency directory. " , PHP_EOL , PHP_EOL ;
181
197
echo "Misc: " , PHP_EOL ;
182
198
echo " -d --deps Path to the dependencies directory. If omited, CWD is used to guess. " , PHP_EOL ;
183
199
echo " -f --force Force the operation even if there are no upgrades available. " , PHP_EOL ;
0 commit comments