Changeset 25 in code for trunk/zs_util.go


Ignore:
Timestamp:
Aug 30, 2015, 12:22:00 PM (10 years ago)
Author:
zaitsev.serge
Message:

fixed output file names in html pages, fixed amber function bindings, replaced print command with build, fixed plugin functions, implemented zs and exec functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zs_util.go

    r24 r25  
    2020        return func(args ...string) string {
    2121                out := bytes.NewBuffer(nil)
    22                 if err := run(cmd, args, vars, out); err != nil {
     22                if err := run(filepath.Join(ZSDIR, cmd), args, vars, out); err != nil {
    2323                        return cmd + ":" + err.Error()
    2424                } else {
     
    2929
    3030func builtins() Funcs {
    31         exec := func(s ...string) string {
     31        exec := func(cmd string, args ...string) string {
     32                out := bytes.NewBuffer(nil)
     33                if err := run(cmd, args, Vars{}, out); err != nil {
     34                        return cmd + ":" + err.Error()
     35                } else {
     36                        return string(out.Bytes())
     37                }
    3238                return ""
    3339        }
     
    3541                "exec": exec,
    3642                "zs": func(args ...string) string {
    37                         cmd := []string{"zs"}
    38                         cmd = append(cmd, args...)
    39                         return exec(cmd...)
     43                        return exec(os.Args[0], args...)
    4044                },
    4145        }
Note: See TracChangeset for help on using the changeset viewer.