includes translations
This commit is contained in:
22
src/bin/tools/downloadAndUnzip.ts
Normal file
22
src/bin/tools/downloadAndUnzip.ts
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
import { basename as pathBasename } from "path";
|
||||
import child_process from "child_process";
|
||||
import fs from "fs";
|
||||
|
||||
export function downloadAndUnzip(
|
||||
params: {
|
||||
url: string;
|
||||
destDirPath: string;
|
||||
}
|
||||
) {
|
||||
|
||||
const { url, destDirPath } = params;
|
||||
|
||||
fs.mkdirSync(destDirPath, { "recursive": true });
|
||||
|
||||
[
|
||||
`wget ${url}`,
|
||||
...["unzip", "rm"].map(prg => `${prg} ${pathBasename(url)}`),
|
||||
].forEach(cmd => child_process.execSync(cmd, { "cwd": destDirPath }));
|
||||
|
||||
}
|
Reference in New Issue
Block a user