Skip to content
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
access=public
enable-pre-post-scripts=true
2 changes: 1 addition & 1 deletion HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ These are the runnable scripts with `npm run`:

General:

- `run-dev`: Run the CLI (with [`tsx`](https://github.com/privatenumber/tsx)). Use `--` to pass arguments to the CLI rather than NPM: \
- `run-dev`: Run the CLI (with [`tsx`](https://github.com/privatenumber/tsx)). Use `--` to pass arguments to the CLI rather than to NPM: \
`npm run run-dev -- extract print --extractor react src/**/*.tsx`
- `build`: Build the CLI.
- `eslint`: Run ESLint.
Expand Down
5 changes: 5 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"description": "Project ID. Only required when using a Personal Access Token.",
"type": ["number", "string"]
},
"branch": {
"description": "Project branch. Use when branching enabled for the project.",
"type": "string",
"minLength": 1
},
"apiUrl": {
"description": "The url of Tolgee API.",
"type": "string"
Expand Down
10 changes: 10 additions & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
STRICT_NAMESPACE,
PARSER,
PROJECT_ID_OPT,
PROJECT_BRANCH,
STRICT_NAMESPACE_NEGATION,
VERBOSE,
} from './options.js';
Expand All @@ -36,6 +37,8 @@ import ExtractCommand from './commands/extract.js';
import CompareCommand from './commands/sync/compare.js';
import SyncCommand from './commands/sync/sync.js';
import TagCommand from './commands/tag.js';
import BranchCommand from './commands/branch.js';
import MergeCommand from './commands/merge.js';

import { getSingleOption } from './utils/getSingleOption.js';
import { Schema } from './schema.js';
Expand Down Expand Up @@ -180,6 +183,7 @@ async function run() {
program.addOption(API_URL_OPT.default(config.apiUrl ?? DEFAULT_API_URL));
program.addOption(API_KEY_OPT.default(config.apiKey));
program.addOption(PROJECT_ID_OPT.default(config.projectId ?? -1));
program.addOption(PROJECT_BRANCH.default(config.branch));
program.addOption(FORMAT_OPT.default(config.format ?? 'JSON_TOLGEE'));
program.addOption(EXTRACTOR.default(config.extractor));
program.addOption(FILE_PATTERNS.default(config.patterns));
Expand Down Expand Up @@ -209,6 +213,12 @@ async function run() {
program.addCommand(
TagCommand(config).configureHelp({ showGlobalOptions: true })
);
program.addCommand(
BranchCommand(config).configureHelp({ showGlobalOptions: true })
);
program.addCommand(
MergeCommand(config).configureHelp({ showGlobalOptions: true })
);

await program.parseAsync();
} catch (e: any) {
Expand Down
4 changes: 4 additions & 0 deletions src/client/errorFromLoadable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export const errorFromLoadable = (loadable: LoadableData) => {
loadable
)}`;

// Not found (e.g. branch in project)
case 404:
return `Requested data not found. Please check your inputs ${addErrorDetails(loadable)}`;

// Rate limited
case 429:
return `You've been rate limited. Please try again later ${addErrorDetails(
Expand Down
Loading
Loading