forked from rakyll/drive
-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #726. Added custom modification time setting with two different modes: + Custom time with an optional format specifier ```shell $ drive touch --time 20120202120000 ComedyPunchlineDrumSound.mp3 /share-testing/ComedyPunchlineDrumSound.mp3: 2012-02-02 12:00:00 +0000 UTC $ drive touch --format "2006-01-02-15:04:05.0000Z" --time "2016-02-03-08:12:15.0070Z" outf.go /share-testing/outf.go: 2016-02-03 08:12:15 +0000 UTC ``` The default format specifier is 20060102150405. The mentioned custom time format has to be relative to how you would represent "Mon Jan 2 15:04:05 -0700 MST 2006". See the documentation for time formatting here [time.Parse](https://golang.org/pkg/time/#Parse) + Custom time offset from the current clock time. ```shell $ drive touch --duration -30h ComedyPunchlineDrumSound.mp3 outf.go /share-testing/outf.go: 2016-09-10 08:06:39 +0000 UTC /share-testing/ComedyPunchlineDrumSound.mp3: 2016-09-10 08:06:39 +0000 UTC ``` To set that file's modTime to 30 hours ago. For allowable duration formats, see https://golang.org/pkg/time/#Parse.
- Loading branch information
Showing
6 changed files
with
208 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters