mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-04-17 04:33:15 +02:00
initial commit
This commit is contained in:
17
.setup/utils/compress.util.ts
Normal file
17
.setup/utils/compress.util.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user