Skip to content

Commit

Permalink
Implemented an augmented.
Browse files Browse the repository at this point in the history
In this case it pulls from stat.
Bad idea.
But, it's just an example.
  • Loading branch information
psycotica0 committed Nov 28, 2011
1 parent f39eb81 commit feac05e
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions default.augmented.do
@@ -1,9 +1,24 @@

# This is meant to use metadata from git, or hg, or the filesystem, or whatever to augment the user-given metadata
# It's meant to fill in all the auto-generatable blanks
# Here we're reading fake data from the file metadata

redo-ifchange "$1.mime"
echo "ID: blah"
echo "Date-Created: YYYY-MM-DD"
echo "Date-Modified: YYYY-MM-DD"

# I don't know how standard the -c option is
modify_time="$(stat -c "%Y" "$1.mime")"
# I can't get creation time from the system reliably
create_time="$modify_time"

# Since create time is arbitrary, this is not a good idea...
# But, this is mostly an example for testing
id="$create_time"

# This is the date format (iso8601)
date_format="%Y-%m-%dT%H:%M:%SZ"

echo "ID: $id"
# I don't know how standard the '@' to set based on epoch time is, but I know the -d isn't super standard
echo "Date-Created: $(date -ud "@$create_time" "+$date_format")"
echo "Date-Modified: $(date -ud "@$modify_time" "+$date_format")"
cat "$1.mime"

0 comments on commit feac05e

Please sign in to comment.