mirror of
https://github.com/stonith404/pingvin-share.git
synced 2024-11-19 05:40:12 +01:00
18 lines
316 B
TypeScript
18 lines
316 B
TypeScript
import fs from "fs";
|
|
import tar from "tar";
|
|
|
|
const zipDirectory = (functionName: string) => {
|
|
tar.create(
|
|
{
|
|
gzip: true,
|
|
sync: true,
|
|
cwd: `./functions/${functionName}`,
|
|
file: "code.tar.gz",
|
|
},
|
|
["./"]
|
|
);
|
|
return fs.realpathSync("code.tar.gz");
|
|
};
|
|
|
|
export default zipDirectory;
|