-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add
:cmd
and commands
to real time edit command file
resolves #100
- Loading branch information
1 parent
d8fbce5
commit 24c5e84
Showing
3 changed files
with
48 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ExecuteContext } from '../execute-context' | ||
import { RunnerWindow } from '../../window/windows/runner' | ||
|
||
export default { | ||
command: ':commands', | ||
alias: [':commands', ':cmd'], | ||
async task(context: ExecuteContext, task?: string): Promise<void> { | ||
context.out('') | ||
if (!task) { | ||
if (!context.workspace.commands.commandFileLocation) { | ||
context.out( | ||
'No command file to edit, make sure ~/mterm/package.json has a proper `main` field' | ||
) | ||
return | ||
} | ||
await context.edit(context.workspace.commands.commandFileLocation, async () => { | ||
context.out('Saved command file!\n') | ||
|
||
await context.workspace.commands.load(context.workspace.settings) | ||
|
||
context.out('Commands reloaded\n') | ||
}) | ||
} | ||
} | ||
} |