mirror of
https://github.com/janet-lang/janet
synced 2025-02-05 03:30:02 +00:00
parent
23c7c3bf1c
commit
d8841de180
18
auxbin/jpm
18
auxbin/jpm
@ -588,16 +588,20 @@ int main(int argc, const char **argv) {
|
|||||||
(rm manifest)
|
(rm manifest)
|
||||||
(print "Uninstalled."))
|
(print "Uninstalled."))
|
||||||
|
|
||||||
|
(defn- rimraf
|
||||||
|
"Hard delete directory tree"
|
||||||
|
[path]
|
||||||
|
(if is-win
|
||||||
|
# windows get rid of read-only files
|
||||||
|
(os/shell `rmdir /S /Q "` path `"`))
|
||||||
|
(rm path))
|
||||||
|
|
||||||
(defn clear-cache
|
(defn clear-cache
|
||||||
"Clear the global git cache."
|
"Clear the global git cache."
|
||||||
[]
|
[]
|
||||||
(def cache (find-cache))
|
(def cache (find-cache))
|
||||||
(print "clearing " cache "...")
|
(print "clearing " cache "...")
|
||||||
(if is-win
|
(rimraf cache))
|
||||||
# Git for windows decided that .git should be hidden and everything in it read-only.
|
|
||||||
# This means we can't delete things easily.
|
|
||||||
(os/shell (string `rmdir /S /Q "` cache `"`))
|
|
||||||
(rm cache)))
|
|
||||||
|
|
||||||
(def- default-pkglist (or (os/getenv "JANET_PKGLIST") "https://github.com/janet-lang/pkgs.git"))
|
(def- default-pkglist (or (os/getenv "JANET_PKGLIST") "https://github.com/janet-lang/pkgs.git"))
|
||||||
|
|
||||||
@ -632,7 +636,9 @@ int main(int argc, const char **argv) {
|
|||||||
(when (mkdir module-dir)
|
(when (mkdir module-dir)
|
||||||
(set fresh true)
|
(set fresh true)
|
||||||
(print "cloning repository " repo " to " module-dir)
|
(print "cloning repository " repo " to " module-dir)
|
||||||
(os/execute ["git" "clone" repo module-dir] :p))
|
(unless (zero? (os/execute ["git" "clone" repo module-dir] :p))
|
||||||
|
(rimraf module-dir)
|
||||||
|
(error (string "could not clone git dependency " repo))))
|
||||||
(def olddir (os/cwd))
|
(def olddir (os/cwd))
|
||||||
(try
|
(try
|
||||||
(with-dyns [:rules @{}
|
(with-dyns [:rules @{}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user