You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
spacefrogg-overlay/factor-lang/0001-pathnames-redirect-wor...

33 lines
1.1 KiB

From 812d79ccfa1d702afc12561aa8c05a9b4a158620 Mon Sep 17 00:00:00 2001
From: timor <timor.dd@googlemail.com>
Date: Thu, 7 Mar 2019 13:49:41 +0100
Subject: [PATCH] pathnames: redirect "work" prefix to ~/.local/share/factor
---
core/io/pathnames/pathnames.factor | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/core/io/pathnames/pathnames.factor b/core/io/pathnames/pathnames.factor
index d1aed3ad82..6104a0c94b 100644
--- a/core/io/pathnames/pathnames.factor
+++ b/core/io/pathnames/pathnames.factor
@@ -136,7 +136,8 @@ HOOK: resolve-symlinks os ( path -- path' )
M: object resolve-symlinks normalize-path ;
: resource-path ( path -- newpath )
- "resource-path" get prepend-path ;
+ dup "work" = [ drop "work/" ] when
+ "work/" ?head [ "~/.local/share/factor" ] [ "resource-path" get ] if prepend-path ;
HOOK: home io-backend ( -- dir )
@@ -219,4 +220,4 @@ C: <pathname> pathname
M: pathname absolute-path string>> absolute-path ;
-M: pathname <=> [ string>> ] compare ;
\ No newline at end of file
+M: pathname <=> [ string>> ] compare ;
--
2.18.1