Repository navigation
This is a minor release that replaces files: URLs with regular file paths.
Upgrade steps
- In your npm
buildscripts, replacefiles:buildwithbuild/. - If you use
files:in your Origami programs (this is rare), remove thefilesand add a trailing slash. - If you use
Protocol.files(rare), replace it withOrigami.files.
File system paths can now reference folders that don't exist yet
Previously specifying a folder that might not exist yet required using the files: protocol. For example, build scripts copied to files:build to handle running the script on a new machine where the build folder didn't exist yet.
Folder paths now support trailing slashes. A trailing slash at the end of a file system path indicates that you want a folder, even if that folder or the intermediate folders don't exist yet.
You can still reference a folder without a trailing slash, like path/to/folder, in which case:
- If
path/to/folderexists, this returns a reference to that folder. - If the intermediate
pathorpath/toexist butpath/to/folderdoesn't, this returnsundefined. - If the intermediate
pathorpath/todon't exist, this throws an exception.
With this change, the standard build script incantation changes to:
ori copy src/site.ori, clear build/
Origami project templates like origami-start and origami-blog-start have had their build scripts updated to the above, so new projects created with them should build the first time without issues.
With this change, the files: protocol is no longer necessary and has been deprecated. A runtime warning will flag any use of files: and recommend using the corresponding path with a trailing slash.
In rare cases you may need to dereference a string that represents a file path. This was previously covered by a builtin called Protocol.files, but going forward that has been renamed to the builtin Origami.files.