patch modify bug incorrectly identifying source file to be replaced
This commit is contained in:
parent
edbb9dc3d4
commit
b3940516d9
1 changed files with 24 additions and 24 deletions
20
modify.rkt
20
modify.rkt
|
@ -1,7 +1,7 @@
|
||||||
#lang cli
|
#lang cli
|
||||||
|
|
||||||
(require (only-in racket/date current-date date->string date-display-format)
|
(require (only-in racket/date current-date date->string date-display-format)
|
||||||
(only-in racket/string string-join non-empty-string?)
|
(only-in racket/string string-join string-split non-empty-string?)
|
||||||
(only-in racket/list first second third fourth fifth last take drop flatten add-between)
|
(only-in racket/list first second third fourth fifth last take drop flatten add-between)
|
||||||
(only-in racket/format ~a)
|
(only-in racket/format ~a)
|
||||||
(only-in racket/exn exn->string)
|
(only-in racket/exn exn->string)
|
||||||
|
@ -79,15 +79,15 @@
|
||||||
;; locate existing post in source
|
;; locate existing post in source
|
||||||
;; (. -> . input-port? output-port?)
|
;; (. -> . input-port? output-port?)
|
||||||
(define (get-source-ports)
|
(define (get-source-ports)
|
||||||
(let ([file-handle (path-add-extension
|
(let*
|
||||||
(if (equal? r-type "root")
|
([file-id (last (string-split n-in "/"))]
|
||||||
(if x-test
|
[file-handle (if (equal? r-type "root")
|
||||||
(build-path "publish-test" "source" l-head)
|
(if x-test
|
||||||
(build-path "source" l-head))
|
(build-path "publish-test" "source" file-id)
|
||||||
(if x-test
|
(build-path "source" file-id))
|
||||||
(build-path "publish-test" "source" r-type l-head)
|
(if x-test
|
||||||
(build-path "source" r-type l-head)))
|
(build-path "publish-test" "source" r-type file-id)
|
||||||
#".scm")])
|
(build-path "source" r-type file-id)))])
|
||||||
(values
|
(values
|
||||||
(open-input-file file-handle)
|
(open-input-file file-handle)
|
||||||
(open-output-file file-handle #:exists 'update))))
|
(open-output-file file-handle #:exists 'update))))
|
||||||
|
|
Loading…
Reference in a new issue