appwrite / appwrite/sdk-for-cli

During deployment, the packaging command did not exclude the ignore files.

Open
#250 0 comments 0 reactions 1 assignee Claimed by @ChiragAgg5k View on GitHub
Dominant language
Go
Stars
100
Forks
45
Avg merge
1d 1h
Merged PRs (30d)
5

Description

### 👟 Reproduction steps

When executing push sites or push functions and selecting deploy, all files under the site or function directory will be packaged.

### 👍 Expected behavior

Filter and exclude based on the .gitignore file in the directory or the ignore configuration in appwrite.config.json.

### 👎 Actual Behavior

In the deployment.ts file,'packageDirectory' function, the tar command does not filter files based on ignore rules, resulting in all files under the site or function directories being packaged into the .tar.gz file, including directories like node_modules.

```
/**
* Package a directory into a tar.gz File object for deployment
* @private - Only used internally by pushDeployment
*/
async function packageDirectory(dirPath: string): Promise {
const tempFile = `${dirPath.replace(/[^a-zA-Z0-9]/g, "_")}-${Date.now()}.tar.gz`;

await tar.create(
{
gzip: true,
file: tempFile,
cwd: dirPath,
},
["."],
);

const buffer = fs.readFileSync(tempFile);
fs.unlinkSync(tempFile);

return new File([buffer], path.basename(tempFile), {
type: "application/gzip",
});
}
```

### 🎲 Appwrite version

Version 1.8.x

### 💻 Operating system

Linux

### 🧱 Your Environment

_No response_

### 👀 Have you spent some time to check if this issue has been raised before?

- [x] I checked and didn't find similar issue

### 🏢 Have you read the Code of Conduct?

- [x] I have read the [Code of Conduct](https://github.com/appwrite/.github/blob/main/CODE_OF_CONDUCT.md)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.