Skip to content

Commit

Permalink
Merge pull request #111 from janpfeifer/script
Browse files Browse the repository at this point in the history
Added note on order of execution of special commands.
  • Loading branch information
janpfeifer authored Apr 5, 2024
2 parents 53a6c44 + 54f3676 commit 9859dd4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/dispatcher/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func handleExecuteRequest(msg kernel.Message, goExec *goexec.State) error {
var executionErr error

if specialCell, err := specialcmd.ExecuteSpecialCell(msg, goExec, lines); specialCell {
executionErr = err
executionErr = err // err may be nil here, if magic cell command was executed correctly.

} else {
if err := specialcmd.Parse(msg, goExec, true, lines, specialLines); err != nil {
Expand Down
3 changes: 3 additions & 0 deletions internal/specialcmd/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ This way each cell can create its own `init_...()` and have it called at every c
- `%with_password`: will prompt for a password passed to the next shell command.
Do this is if your next shell command requires a password.

Notice all these commands are executed **before** any Go code in the same cell.

### Managing Memorized Definitions

Expand Down Expand Up @@ -91,6 +92,8 @@ This way each cell can create its own `init_...()` and have it called at every c
for instance to get a package from some specific version, something
like `!*go get github.com/my/package@v3`.

Notice that when the cell is executed, first all shell commands are executed, and only after that, if there is
any Go code in the cell, it is executed.

### Tracking of Go Files In Development:

Expand Down

0 comments on commit 9859dd4

Please sign in to comment.