Skip to content

Commit

Permalink
fix: can not save history if abort on non-interactive mode
Browse files Browse the repository at this point in the history
  • Loading branch information
snowyu committed Jun 18, 2024
1 parent 932d699 commit 212ae5d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ rules:
unicorn/prefer-ternary: off
dot-notation: off
max-depth: ['warn', 10]
complexity: ['warn', 40]
complexity: ['warn', 80]
unicorn/escape-case: off
import/no-named-as-default-member: off
unicorn/catch-error-name: off
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ $ npm install -g @offline-ai/cli
$ ai COMMAND
running command...
$ ai (--version)
@offline-ai/cli/0.0.10 linux-x64 node-v20.14.0
@offline-ai/cli/0.0.11 linux-x64 node-v20.14.0
$ ai --help [COMMAND]
USAGE
$ ai COMMAND
Expand Down Expand Up @@ -302,7 +302,7 @@ EXAMPLES
$ ai agent publish <agent-name>
```

_See code: [src/commands/agent/index.ts](https://github.com/offline-ai/cli/blob/v0.0.10/src/commands/agent/index.ts)_
_See code: [src/commands/agent/index.ts](https://github.com/offline-ai/cli/blob/v0.0.11/src/commands/agent/index.ts)_

## `ai autocomplete [SHELL]`

Expand Down Expand Up @@ -375,7 +375,7 @@ EXAMPLES
$ ai brain download <brain-name>
```

_See code: [src/commands/brain/index.ts](https://github.com/offline-ai/cli/blob/v0.0.10/src/commands/brain/index.ts)_
_See code: [src/commands/brain/index.ts](https://github.com/offline-ai/cli/blob/v0.0.11/src/commands/brain/index.ts)_

## `ai brain dn [NAME]`

Expand Down Expand Up @@ -503,7 +503,7 @@ EXAMPLES
$ ai brain download <brain-name> [-q <QUANT>]
```

_See code: [src/commands/brain/download.ts](https://github.com/offline-ai/cli/blob/v0.0.10/src/commands/brain/download.ts)_
_See code: [src/commands/brain/download.ts](https://github.com/offline-ai/cli/blob/v0.0.11/src/commands/brain/download.ts)_

## `ai brain list [NAME]`

Expand Down Expand Up @@ -532,7 +532,7 @@ GLOBAL FLAGS
--json Format output as json.
```

_See code: [src/commands/brain/list.ts](https://github.com/offline-ai/cli/blob/v0.0.10/src/commands/brain/list.ts)_
_See code: [src/commands/brain/list.ts](https://github.com/offline-ai/cli/blob/v0.0.11/src/commands/brain/list.ts)_

## `ai config [ITEM_NAME]`

Expand Down Expand Up @@ -569,7 +569,7 @@ EXAMPLES
}
```

_See code: [src/commands/config/index.ts](https://github.com/offline-ai/cli/blob/v0.0.10/src/commands/config/index.ts)_
_See code: [src/commands/config/index.ts](https://github.com/offline-ai/cli/blob/v0.0.11/src/commands/config/index.ts)_

## `ai config save [DATA]`

Expand Down Expand Up @@ -609,7 +609,7 @@ GLOBAL FLAGS
--json Format output as json.
```

_See code: [src/commands/config/save.ts](https://github.com/offline-ai/cli/blob/v0.0.10/src/commands/config/save.ts)_
_See code: [src/commands/config/save.ts](https://github.com/offline-ai/cli/blob/v0.0.11/src/commands/config/save.ts)_

## `ai help [COMMAND]`

Expand Down Expand Up @@ -969,7 +969,7 @@ EXAMPLES
│[info]:Start Script: ...
```

_See code: [src/commands/run/index.ts](https://github.com/offline-ai/cli/blob/v0.0.10/src/commands/run/index.ts)_
_See code: [src/commands/run/index.ts](https://github.com/offline-ai/cli/blob/v0.0.11/src/commands/run/index.ts)_

## `ai version`

Expand Down
2 changes: 2 additions & 0 deletions src/lib/run-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ export async function runScript(filename: string, options: IRunScriptOptions) {

try {
await runtime.run(options.data)
} catch(error: any) {
if (error.name !== 'AbortError') {throw error}
} finally {
if (!isSilence && !options.noConsoleClear) {logUpdate.clear()}
}
Expand Down

0 comments on commit 212ae5d

Please sign in to comment.