]> gitweb.factorcode.org Git - factor.git/blob - basis/tools/deploy/config/editor/editor.factor
c9ecac3b0a627f09e0ffa1f5fa91b1f8bdafb50a
[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 io.pathnames kernel parser prettyprint
4 prettyprint.config sequences splitting tools.deploy.config
5 vocabs.loader vocabs.metadata ;
6 IN: tools.deploy.config.editor
7
8 : deploy-config-path ( vocab -- path/f )
9     "deploy.factor" vocab-file-path ;
10
11 : deploy-config ( vocab -- assoc )
12     [ default-config ] keep
13     "deploy.factor" vocab-file-lines
14     parse-fresh [ first assoc-union ] unless-empty ;
15
16 : set-deploy-config ( assoc vocab -- )
17     [ [ unparse-use ] without-limits string-lines ] dip
18     "deploy.factor" set-vocab-file-lines ;
19
20 : set-deploy-flag ( value key vocab -- )
21     [ deploy-config [ set-at ] keep ] keep set-deploy-config ;