Skip to content

Commit

Permalink
scripting: run script in :ciel-user by default
Browse files Browse the repository at this point in the history
  • Loading branch information
vindarel committed Apr 22, 2024
1 parent e9c7946 commit fc54b6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/scripting.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ $ ciel -s simpleHTTPserver 9000
#!/usr/bin/env ciel
;; optional shebang line, only for the short ./script call)
;; Start your script with this to access all CIEL goodies:
;; Start your script with this to access all CIEL goodies.
;; It is now also optional.
(in-package :ciel-user)
(defun hello (name)
Expand Down
3 changes: 2 additions & 1 deletion scripting.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@
;; The remaining free args are passed along to our script's arguments.
;; Here the file name is already a free arg, so args equals something like
;; '("simpleHTTPserver.lisp" "4242") aka it has the file name.
(let ((ciel-user:*script-args* args))
(let ((ciel-user:*script-args* args)
(*package* (find-package :ciel-user)))
(if (has-shebang (first args))
;; I was a bit cautious about this function.
;; (mostly, small issues when testing at the REPL because of packages and local nicknames,
Expand Down

0 comments on commit fc54b6c

Please sign in to comment.