From 653af68a8e897166a6ed9a8f59e2f28407d1d55b Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Thu, 15 Mar 2018 08:45:12 -0500 Subject: [PATCH] Revert "use tilde paths instead of home append-path." This reverts commit 8af27125ec0c0966867da7490db53a1cf071de7a. --- basis/command-line/command-line.factor | 9 ++++++--- .../visual-studio-code/visual-studio-code.factor | 2 +- basis/tools/scaffold/scaffold-docs.factor | 15 +++++++++++---- basis/tools/scaffold/scaffold.factor | 13 ++++++++----- extra/cpu/8080/emulator/emulator.factor | 2 +- extra/mason/config/config.factor | 14 +++++++++++--- extra/mason/release/sign/sign.factor | 6 ++++-- extra/webapps/mason/backend/backend.factor | 2 +- extra/websites/concatenative/concatenative.factor | 8 ++++---- 9 files changed, 47 insertions(+), 24 deletions(-) diff --git a/basis/command-line/command-line.factor b/basis/command-line/command-line.factor index 39217ce61d..aeb26c8e5e 100644 --- a/basis/command-line/command-line.factor +++ b/basis/command-line/command-line.factor @@ -24,6 +24,9 @@ SYMBOL: command-line : (command-line) ( -- args ) OBJ-ARGS special-object sift [ alien>native-string ] map ; +: rc-path ( name -- path ) + home prepend-path ; + : try-user-init ( file -- ) "user-init" get swap '[ _ [ ?run-file ] [ @@ -34,14 +37,14 @@ SYMBOL: command-line ] when ; : run-bootstrap-init ( -- ) - "~/.factor-boot-rc" try-user-init ; + ".factor-boot-rc" rc-path try-user-init ; : run-user-init ( -- ) - "~/.factor-rc" try-user-init ; + ".factor-rc" rc-path try-user-init ; : load-vocab-roots ( -- ) "user-init" get [ - "~/.factor-roots" dup exists? [ + ".factor-roots" rc-path dup exists? [ utf8 file-lines harvest [ add-vocab-root ] each ] [ drop ] if "roots" get [ diff --git a/basis/editors/visual-studio-code/visual-studio-code.factor b/basis/editors/visual-studio-code/visual-studio-code.factor index 910e07d883..3b43d7443c 100644 --- a/basis/editors/visual-studio-code/visual-studio-code.factor +++ b/basis/editors/visual-studio-code/visual-studio-code.factor @@ -33,7 +33,7 @@ M: linux find-visual-studio-code-invocation { [ "code" which ] [ "Code" which ] - [ "~/VSCode-linux-x64/Code" ] + [ home "VSCode-linux-x64/Code" append-path ] [ "/usr/share/code/code" ] } [ [ exists? ] ?1arg ] map-compose 0|| ; diff --git a/basis/tools/scaffold/scaffold-docs.factor b/basis/tools/scaffold/scaffold-docs.factor index 7c047a59b7..2667d6b5db 100644 --- a/basis/tools/scaffold/scaffold-docs.factor +++ b/basis/tools/scaffold/scaffold-docs.factor @@ -101,16 +101,22 @@ HELP: scaffold-vocab { $description "Creates a directory in the given root for a new vocabulary and adds a main .factor file and an authors.txt file." } ; HELP: scaffold-emacs -{ $description "Touches the " { $snippet ".emacs" } " file in your home directory and provides a clickable link to open it in an editor." } ; +{ $description "Touches the .emacs file in your home directory and provides a clickable link to open it in an editor." } ; HELP: scaffold-factor-boot-rc -{ $description "Touches the " { $snippet ".factor-boot-rc" } " file in your home directory and provides a clickable link to open it in an editor." } ; +{ $description "Touches the .factor-boot-rc file in your home directory and provides a clickable link to open it in an editor." } ; HELP: scaffold-factor-rc -{ $description "Touches the " { $snippet ".factor-rc" } " file in your home directory and provides a clickable link to open it in an editor." } ; +{ $description "Touches the .factor-rc file in your home directory and provides a clickable link to open it in an editor." } ; HELP: scaffold-factor-roots -{ $description "Touches the " { $snippet ".factor-roots" } " file in your home directory and provides a clickable link to open it in an editor." } ; +{ $description "Touches the .factor-roots file in your home directory and provides a clickable link to open it in an editor." } ; + +HELP: scaffold-rc +{ $values + { "path" "a pathname string" } +} +{ $description "Touches the given path in your home directory and provides a clickable link to open it in an editor." } ; HELP: using { $description "Stores the vocabularies that are pulled into the documentation file from looking up the stack effect types." } ; @@ -131,6 +137,7 @@ ARTICLE: "tools.scaffold" "Scaffold tool" "Types that are unrecognized by the scaffold generator will be of type " { $link null } ". The developer should change these to strings that describe the stack effect names instead." $nl "Scaffolding a configuration file:" { $subsections + scaffold-rc scaffold-factor-boot-rc scaffold-factor-rc scaffold-factor-roots diff --git a/basis/tools/scaffold/scaffold.factor b/basis/tools/scaffold/scaffold.factor index 6add7a9083..db602ce4e5 100644 --- a/basis/tools/scaffold/scaffold.factor +++ b/basis/tools/scaffold/scaffold.factor @@ -360,18 +360,21 @@ ${example-indent}} [ touch-file ] [ "Click to edit: " write . ] bi ; +: scaffold-rc ( path -- ) + [ home ] dip append-path scaffold-file ; + : scaffold-factor-boot-rc ( -- ) - "~/.factor-boot-rc" scaffold-file ; + ".factor-boot-rc" scaffold-rc ; : scaffold-factor-rc ( -- ) - "~/.factor-rc" scaffold-file ; + ".factor-rc" scaffold-rc ; : scaffold-mason-rc ( -- ) - "~/.factor-mason-rc" scaffold-file ; + ".factor-mason-rc" scaffold-rc ; : scaffold-factor-roots ( -- ) - "~/.factor-roots" scaffold-file ; + ".factor-roots" scaffold-rc ; HOOK: scaffold-emacs os ( -- ) -M: unix scaffold-emacs ( -- ) "~/.emacs" scaffold-file ; +M: unix scaffold-emacs ( -- ) ".emacs" scaffold-rc ; diff --git a/extra/cpu/8080/emulator/emulator.factor b/extra/cpu/8080/emulator/emulator.factor index 9db998d259..adb06e68f0 100644 --- a/extra/cpu/8080/emulator/emulator.factor +++ b/extra/cpu/8080/emulator/emulator.factor @@ -453,7 +453,7 @@ SYMBOL: rom-root : rom-dir ( -- string ) rom-root get [ - "~/roms" dup exists? [ drop f ] unless + home "roms" append-path dup exists? [ drop f ] unless ] unless* ; : load-rom* ( seq cpu -- ) diff --git a/extra/mason/config/config.factor b/extra/mason/config/config.factor index 971c0aa466..04adaaf0e9 100644 --- a/extra/mason/config/config.factor +++ b/extra/mason/config/config.factor @@ -5,7 +5,10 @@ IN: mason.config ! (Optional) Location for build directories SYMBOL: builds-dir -builds-dir [ "~/builds" ] initialize + +builds-dir get-global [ + home "builds" append-path builds-dir set-global +] unless ! Who sends build report e-mails. SYMBOL: builder-from @@ -15,11 +18,13 @@ SYMBOL: builder-recipients ! (Optional) CPU architecture to build for. SYMBOL: target-cpu -target-cpu [ cpu ] initialize + +target-cpu get-global [ cpu target-cpu set-global ] unless ! (Optional) OS to build for. SYMBOL: target-os -target-os [ os ] initialize + +target-os get-global [ os target-os set-global ] unless ! (Optional) Architecture variant suffix. SYMBOL: target-variant @@ -32,10 +37,12 @@ SYMBOL: builder-debug ! URL for counter notifications. SYMBOL: counter-url + counter-url [ "http://builds.factorcode.org/counter" ] initialize ! URL for status notifications. SYMBOL: status-url + status-url [ "http://builds.factorcode.org/status-update" ] initialize ! Password for status notifications. @@ -56,6 +63,7 @@ SYMBOL: docs-directory ! URL to notify server about new docs SYMBOL: docs-update-url + docs-update-url [ "http://builds.factorcode.org/docs-update" ] initialize ! Boolean. Do we upload package binaries? diff --git a/extra/mason/release/sign/sign.factor b/extra/mason/release/sign/sign.factor index 9608bdf707..de25df6268 100644 --- a/extra/mason/release/sign/sign.factor +++ b/extra/mason/release/sign/sign.factor @@ -19,9 +19,11 @@ HOOK: cert-path os ( -- path/f ) M: object cert-path f ; -M: macosx cert-path "~/config/mac_app.cer" ; +M: macosx cert-path + home "config/mac_app.cer" append-path ; -M: windows cert-path "~/config/FactorSPC.pfx" ; +M: windows cert-path + home "config/FactorSPC.pfx" append-path ; >> HOOK: sign-factor-app os ( -- ) diff --git a/extra/webapps/mason/backend/backend.factor b/extra/webapps/mason/backend/backend.factor index 11d6179c8b..ad9a66e3d7 100644 --- a/extra/webapps/mason/backend/backend.factor +++ b/extra/webapps/mason/backend/backend.factor @@ -82,7 +82,7 @@ counter "COUNTER" { : os/cpu ( builder -- string ) [ os>> ] [ cpu>> ] bi "/" glue ; -: mason-db ( -- db ) "~/mason.db" ; +: mason-db ( -- db ) home "mason.db" append-path ; : with-mason-db ( quot -- ) mason-db [ with-transaction ] with-db ; inline diff --git a/extra/websites/concatenative/concatenative.factor b/extra/websites/concatenative/concatenative.factor index 91b4ad3a3e..a004702d41 100644 --- a/extra/websites/concatenative/concatenative.factor +++ b/extra/websites/concatenative/concatenative.factor @@ -31,7 +31,7 @@ webapps.mason.backend.watchdog websites.factorcode ; IN: websites.concatenative -: website-db ( -- db ) "~/website.db" ; +: website-db ( -- db ) home "website.db" append-path ; : init-factor-db ( -- ) mason-db [ init-mason-db ] with-db @@ -107,9 +107,9 @@ SYMBOLS: key-password key-file dh-file ; website-db "paste.factorcode.org" add-responder website-db "planet.factorcode.org" add-responder website-db "builds.factorcode.org" add-responder - "~/docs" "docs.factorcode.org" add-responder - "~/cgi" "gitweb.factorcode.org" add-responder - "~/irclogs" t >>allow-listings "irclogs.factorcode.org" add-responder + home "docs" append-path "docs.factorcode.org" add-responder + home "cgi" append-path "gitweb.factorcode.org" add-responder + home "irclogs" append-path t >>allow-listings "irclogs.factorcode.org" add-responder main-responder set-global ; : ( -- config )