mirror of
https://github.com/janet-lang/janet
synced 2025-01-11 08:00:27 +00:00
Assert that prime-bunlde-paths is working.
This commit is contained in:
parent
6998865d7b
commit
1225cd31c8
@ -4023,7 +4023,10 @@
|
||||
|
||||
(defn- prime-bundle-paths
|
||||
[]
|
||||
(os/mkdir (bundle-dir)))
|
||||
(def s (sep))
|
||||
(def path (string (dyn *syspath*) s "bundle"))
|
||||
(os/mkdir path)
|
||||
(assert (os/stat path :mode)))
|
||||
|
||||
(defn- get-files [manifest]
|
||||
(def files (get manifest :files @[]))
|
||||
@ -4223,6 +4226,8 @@
|
||||
(assert (next bundle-name) "cannot use empty bundle-name")
|
||||
(assert (not (fexists (get-manifest-filename bundle-name)))
|
||||
"bundle is already installed")
|
||||
# Setup installed paths
|
||||
(prime-bundle-paths)
|
||||
# Check meta file for dependencies
|
||||
(def infofile-pre (string path s "bundle" s "info.jdn"))
|
||||
(when (os/stat infofile-pre :mode)
|
||||
@ -4230,8 +4235,6 @@
|
||||
(def deps (get info :deps @[]))
|
||||
(def missing (seq [d :in deps :when (not (bundle/installed? d))] (string d)))
|
||||
(when (next missing) (errorf "missing dependencies %s" (string/join missing ", "))))
|
||||
# Setup installed paths
|
||||
(prime-bundle-paths)
|
||||
(os/mkdir (bundle-dir bundle-name))
|
||||
# Copy some files into the new location unconditionally
|
||||
(def implicit-sources (string path s "bundle"))
|
||||
|
@ -2417,8 +2417,9 @@ JANET_CORE_FN(os_dir,
|
||||
dp = readdir(dfd);
|
||||
if (dp == NULL) {
|
||||
if (errno) {
|
||||
int olderr = errno;
|
||||
closedir(dfd);
|
||||
janet_panicf("failed to read directory %s: %s", dir, janet_strerror(errno));
|
||||
janet_panicf("failed to read directory %s: %s", dir, janet_strerror(olderr));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user