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