File: touch.go

package info (click to toggle)
golang-doozer 0.0~git20130909-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 224 kB
  • ctags: 283
  • sloc: makefile: 11
file content (20 lines) | stat: -rw-r--r-- 414 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package main

func init() {
	cmds["touch"] = cmd{touch, "<path>", "update rev of a file"}
	cmdHelp["touch"] = `Attempts to update the rev of a file to a value greater than
the current rev. If a file does not exist, it will be created.
`
}

func touch(path string) {
	c := dial()
	body, rev, err := c.Get(path, nil)
	if err != nil {
		bail(err)
	}
	_, err = c.Set(path, rev, body)
	if err != nil {
		bail(err)
	}
}