mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-21 14:49:18 +02:00
save-history should ensure the directory exists
This commit is contained in:
parent
5b6ca8e760
commit
d222b152b6
2 changed files with 3 additions and 1 deletions
|
@ -47,6 +47,7 @@
|
||||||
(define (save-history cfg)
|
(define (save-history cfg)
|
||||||
(let ((history-file (conf-input-history-file cfg)))
|
(let ((history-file (conf-input-history-file cfg)))
|
||||||
(guard (exn (else (warn "couldn't save history to " history-file)))
|
(guard (exn (else (warn "couldn't save history to " history-file)))
|
||||||
|
(create-directory* (path-directory history-file))
|
||||||
(call-with-output-file history-file
|
(call-with-output-file history-file
|
||||||
(lambda (out)
|
(lambda (out)
|
||||||
(write (remove (lambda (x) (equal? x ""))
|
(write (remove (lambda (x) (equal? x ""))
|
||||||
|
|
|
@ -4,5 +4,6 @@
|
||||||
restore-history save-history)
|
restore-history save-history)
|
||||||
(import (scheme base) (scheme char) (scheme read) (scheme write)
|
(import (scheme base) (scheme char) (scheme read) (scheme write)
|
||||||
(scheme file) (scheme process-context) (srfi 1)
|
(scheme file) (scheme process-context) (srfi 1)
|
||||||
(chibi config) (chibi show) (chibi stty) (chibi term edit-line))
|
(chibi config) (chibi filesystem) (chibi pathname)
|
||||||
|
(chibi show) (chibi stty) (chibi term edit-line))
|
||||||
(include "interface.scm"))
|
(include "interface.scm"))
|
||||||
|
|
Loading…
Add table
Reference in a new issue