diff --git a/package.json b/package.json index fe7e083..11dc91e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shsf-cli", - "version": "2.2.4", + "version": "2.2.5", "description": "", "type": "module", "files": [ diff --git a/src/commands/remote/push.ts b/src/commands/remote/push.ts index 874131e..0c728f0 100644 --- a/src/commands/remote/push.ts +++ b/src/commands/remote/push.ts @@ -79,10 +79,18 @@ export const pushDefinition = { ); const currentFiles = currentFilesResponse.data.data; // Expecting { name: string, id: string [...] }[] - const files = fs.readdirSync(options.from).map((file) => ({ - filename: file, - content: fs.readFileSync(path.join(options.from, file), "utf-8"), - })); + // Read local files and filter to only include files (exclude directories) + const files = fs + .readdirSync(options.from) + .map((file) => { + const filePath = path.join(options.from, file); + return { filename: file, filePath }; + }) + .filter(({ filePath }) => fs.statSync(filePath).isFile()) + .map(({ filename, filePath }) => ({ + filename, + content: fs.readFileSync(filePath, "utf-8"), + })); if (!options.force && files.length > 5) { console.log(