]> gitweb.factorcode.org Git - factor.git/blob - basis/tools/deploy/config/editor/editor.factor
factor: trim more using lists.
[factor.git] / basis / tools / deploy / config / editor / editor.factor
1 ! Copyright (C) 2008, 2010 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: assocs kernel parser prettyprint prettyprint.config
4 sequences splitting tools.deploy.config vocabs.metadata ;
5 IN: tools.deploy.config.editor
6
7 : deploy-config-path ( vocab -- path/f )
8     "deploy.factor" vocab-file-path ;
9
10 : deploy-config ( vocab -- assoc )
11     [ default-config ] keep
12     "deploy.factor" vocab-file-lines
13     parse-fresh [ first assoc-union ] unless-empty ;
14
15 : set-deploy-config ( assoc vocab -- )
16     [ [ unparse-use ] without-limits split-lines ] dip
17     "deploy.factor" set-vocab-file-lines ;
18
19 : set-deploy-flag ( value key vocab -- )
20     [ deploy-config [ set-at ] keep ] keep set-deploy-config ;