: (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 ] [
] 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 [
{
[ "code" which ]
[ "Code" which ]
- [ "~/VSCode-linux-x64/Code" ]
+ [ home "VSCode-linux-x64/Code" append-path ]
[ "/usr/share/code/code" ]
} [ [ exists? ] ?1arg ] map-compose 0|| ;
{ $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." } ;
"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
[ touch-file ]
[ "Click to edit: " write <pathname> . ] 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 ;
: 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 -- )
! (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
! (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
! 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.
! 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?
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 ( -- )
: os/cpu ( builder -- string )
[ os>> ] [ cpu>> ] bi "/" glue ;
-: mason-db ( -- db ) "~/mason.db" <sqlite-db> ;
+: mason-db ( -- db ) home "mason.db" append-path <sqlite-db> ;
: with-mason-db ( quot -- )
mason-db [ with-transaction ] with-db ; inline
websites.factorcode ;
IN: websites.concatenative
-: website-db ( -- db ) "~/website.db" <sqlite-db> ;
+: website-db ( -- db ) home "website.db" append-path <sqlite-db> ;
: init-factor-db ( -- )
mason-db [ init-mason-db ] with-db
<pastebin> <factor-recaptcha> <login-config> <factor-boilerplate> website-db <alloy> "paste.factorcode.org" add-responder
<planet> <login-config> <factor-boilerplate> website-db <alloy> "planet.factorcode.org" add-responder
<mason-app> <login-config> <factor-boilerplate> website-db <alloy> "builds.factorcode.org" add-responder
- "~/docs" <help-webapp> "docs.factorcode.org" add-responder
- "~/cgi" <gitweb> "gitweb.factorcode.org" add-responder
- "~/irclogs" <static> t >>allow-listings "irclogs.factorcode.org" add-responder
+ home "docs" append-path <help-webapp> "docs.factorcode.org" add-responder
+ home "cgi" append-path <gitweb> "gitweb.factorcode.org" add-responder
+ home "irclogs" append-path <static> t >>allow-listings "irclogs.factorcode.org" add-responder
main-responder set-global ;
: <factor-secure-config> ( -- config )