Skip to content

Commit

Permalink
fix: fix publish piece command
Browse files Browse the repository at this point in the history
  • Loading branch information
kishanprmr committed Jan 22, 2025
1 parent aba13e0 commit 8d1a2de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"rcVersion": "0.39.0-rc.0",
"scripts": {
"prepare": "husky install",
"publish-piece": "npx ts-node tools/scripts/pieces/publish-piece.ts",
"serve:frontend": "nx serve react-ui",
"serve:backend": "nx serve server-api",
"serve:engine": "nx serve engine",
Expand All @@ -17,6 +16,7 @@
"create-action": "npx ts-node packages/cli/src/index.ts actions create",
"create-trigger": "npx ts-node packages/cli/src/index.ts triggers create",
"sync-pieces": "npx ts-node packages/cli/src/index.ts pieces sync",
"publish-piece": "npx ts-node tools/scripts/pieces/publish-piece.ts",
"pieces": "npx ts-node packages/cli/src/index.ts pieces",
"workers": "npx ts-node packages/cli/src/index.ts workers",
"pull-i18n": "crowdin pull --config crowdin.yml",
Expand Down
7 changes: 4 additions & 3 deletions tools/scripts/pieces/publish-piece.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ export const publishPiece = async (name: string): Promise<void> => {

const distPaths = await findAllPiecesDirectoryInSource()
const directory = distPaths.find(path => {
const normalizedPath = path.replace(/\\/g, '/')
const parts = normalizedPath.split('/')
return parts[parts.length - 1] === name
if (path.endsWith(`/${name}`)) {
return true;
}
return false
})
if (isNil(directory)) {
console.error(chalk.red(`[publishPiece] can't find the directory with name ${name}`))
Expand Down

0 comments on commit 8d1a2de

Please sign in to comment.