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
7 : deploy-config-path ( vocab -- path/f )
8 "deploy.factor" vocab-file-path ;
10 : deploy-config ( vocab -- assoc )
11 [ default-config ] keep
12 "deploy.factor" vocab-file-lines
13 parse-fresh [ first assoc-union ] unless-empty ;
15 : set-deploy-config ( assoc vocab -- )
16 [ [ unparse-use ] without-limits split-lines ] dip
17 "deploy.factor" set-vocab-file-lines ;
19 : set-deploy-flag ( value key vocab -- )
20 [ deploy-config [ set-at ] keep ] keep set-deploy-config ;