Skip to content

Commit 536ec34

Browse files
committed
fix(cli): allow relative path in bynary uploads
1 parent c7cb4f7 commit 536ec34

3 files changed

Lines changed: 2 additions & 11 deletions

File tree

components/cli/bun.lockb

0 Bytes
Binary file not shown.

components/cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@crystallize/cli",
3-
"version": "5.8",
3+
"version": "5.8.1",
44
"description": "Crystallize CLI",
55
"module": "src/index.ts",
66
"repository": "https://github.com/CrystallizeAPI/crystallize-cli",
@@ -26,7 +26,7 @@
2626
"react-devtools-core": "^7.0.0"
2727
},
2828
"dependencies": {
29-
"@crystallize/js-api-client": "^5",
29+
"@crystallize/js-api-client": "^5.2.0",
3030
"@crystallize/schema": "^5",
3131
"awilix": "^12.0.5",
3232
"cli-spinners": "^3.3.0",

components/cli/src/domain/use-cases/upload-binaries.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,6 @@ const handler = async (envelope: Envelope<UploadBinariesCommand>, deps: Deps) =>
4242
for (const file of paths) {
4343
const cleanPath = file.split('/').slice(-2).join('/');
4444
logger.info(`Uploading file: ${pc.yellow(file)}`);
45-
if (!file.startsWith('/')) {
46-
throw new Error(`File path must be absolute: ${file}`);
47-
}
48-
if (file.includes('..')) {
49-
throw new Error(`File path must not contain .. : ${file}`);
50-
}
51-
if (file.endsWith('/')) {
52-
throw new Error(`File path must not be a folder: ${file}`);
53-
}
5445
const key = await getKey(file, type);
5546
logger.debug(`File uploaded and registered successfully to ${pc.yellow(key)}`);
5647
results[cleanPath.replaceAll('/', '-').replaceAll('.', '-')] = key;

0 commit comments

Comments
 (0)