zilch-cli-rust: filter out target directories
This commit is contained in:
parent
0ffa327f9b
commit
cb046ea859
1 changed files with 9 additions and 3 deletions
|
|
@ -79,7 +79,13 @@ executables in the crate, if unspecified)
|
||||||
|
|
||||||
(define crate-dir (let ((m (assoc 'crate-dir options))) (if m (cdr m) (current-directory))))
|
(define crate-dir (let ((m (assoc 'crate-dir options))) (if m (cdr m) (current-directory))))
|
||||||
|
|
||||||
(define root-vfs (vfs-from-directory crate-dir))
|
(define (remove-target-dir vfs)
|
||||||
|
(vfs-dir-filter-all
|
||||||
|
(lambda (dirname)
|
||||||
|
(not (string=? dirname "target")))
|
||||||
|
vfs))
|
||||||
|
|
||||||
|
(define root-vfs (remove-target-dir (vfs-from-directory crate-dir)))
|
||||||
|
|
||||||
(define-values (cargo-toml cargo-workspace) (parse-cargo-toml root-vfs (read-file (string-append crate-dir "/Cargo.toml")) #f))
|
(define-values (cargo-toml cargo-workspace) (parse-cargo-toml root-vfs (read-file (string-append crate-dir "/Cargo.toml")) #f))
|
||||||
(define projects '())
|
(define projects '())
|
||||||
|
|
@ -94,7 +100,7 @@ executables in the crate, if unspecified)
|
||||||
(let*
|
(let*
|
||||||
((root (if (and (pair? path) (eq? (car path) 'workspace)) crate-dir dirname))
|
((root (if (and (pair? path) (eq? (car path) 'workspace)) crate-dir dirname))
|
||||||
(new-path (string-append root "/" (if (pair? path) (cdr path) path))))
|
(new-path (string-append root "/" (if (pair? path) (cdr path) path))))
|
||||||
(append-dir new-path (vfs-from-directory new-path) workspace))))
|
(append-dir new-path (remove-target-dir (vfs-from-directory new-path)) workspace))))
|
||||||
(for-each check-dep (cargo-crate-dependencies crate))
|
(for-each check-dep (cargo-crate-dependencies crate))
|
||||||
(for-each check-dep (cargo-crate-build-dependencies crate)))
|
(for-each check-dep (cargo-crate-build-dependencies crate)))
|
||||||
|
|
||||||
|
|
@ -122,7 +128,7 @@ executables in the crate, if unspecified)
|
||||||
(for-each
|
(for-each
|
||||||
(lambda (kv)
|
(lambda (kv)
|
||||||
(when (eq? (car kv) 'replace)
|
(when (eq? (car kv) 'replace)
|
||||||
(append-dir (cdr kv) (vfs-from-directory (cdr kv)) #f)))
|
(append-dir (cdr kv) (remove-target-dir (vfs-from-directory (cdr kv))) #f)))
|
||||||
options)
|
options)
|
||||||
|
|
||||||
(define lockfile (parse-lockfile (read-file (string-append crate-dir "/Cargo.lock"))))
|
(define lockfile (parse-lockfile (read-file (string-append crate-dir "/Cargo.lock"))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue