1
0
mirror of https://github.com/stonith404/pingvin-share.git synced 2024-11-19 05:40:12 +01:00
pingvin-share/.setup/utils/compress.util.ts

18 lines
316 B
TypeScript
Raw Normal View History

2022-04-25 15:15:17 +02:00
import fs from "fs";
import tar from "tar";
const zipDirectory = (functionName: string) => {
tar.create(
{
gzip: true,
sync: true,
2022-05-06 12:08:10 +02:00
cwd: `./functions/${functionName}`,
2022-04-25 15:15:17 +02:00
file: "code.tar.gz",
},
["./"]
);
return fs.realpathSync("code.tar.gz");
};
export default zipDirectory;