]> gitweb.factorcode.org Git - factor.git/blob - basis/tools/deploy/config/editor/editor.factor
Merge branch 'master' into experimental
[factor.git] / basis / tools / deploy / config / editor / editor.factor
1 ! Copyright (C) 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: assocs io.pathnames kernel parser prettyprint sequences
4 splitting tools.deploy.config tools.vocabs vocabs.loader ;
5 IN: tools.deploy.config.editor
6
7 : deploy-config-path ( vocab -- string )
8     vocab-dir "deploy.factor" append-path ;
9
10 : deploy-config ( vocab -- assoc )
11     dup default-config swap
12     dup deploy-config-path vocab-file-contents
13     parse-fresh [ first assoc-union ] unless-empty ;
14
15 : set-deploy-config ( assoc vocab -- )
16     [ unparse-use string-lines ] dip
17     dup deploy-config-path set-vocab-file-contents ;
18
19 : set-deploy-flag ( value key vocab -- )
20     [ deploy-config [ set-at ] keep ] keep set-deploy-config ;