L
Lawrence D'Oliveiro
The following one-liner sets the versionName attribute in
AndroidManifest.xml to a number based on the number of days (accurate to
0.1 day) since the *nix epoch. This is what I’ve been using for a
version number in one or two projects, in lieu of anything that makes
more sense.
sed -i -r 's/(android:versionName=\")[^\"]*(\")/\1'"$(bc <<<"scale = 1; ($(Julian -f) - $(Julian -d 1970 1 1)) / 1")"'\2/' AndroidManifest.xml
This needs my “Julian†script, available here
<https://github.com/ldo/Julian>. Though it can probably be rewritten
to do without it, using the GNU “date†command instead...
AndroidManifest.xml to a number based on the number of days (accurate to
0.1 day) since the *nix epoch. This is what I’ve been using for a
version number in one or two projects, in lieu of anything that makes
more sense.
sed -i -r 's/(android:versionName=\")[^\"]*(\")/\1'"$(bc <<<"scale = 1; ($(Julian -f) - $(Julian -d 1970 1 1)) / 1")"'\2/' AndroidManifest.xml
This needs my “Julian†script, available here
<https://github.com/ldo/Julian>. Though it can probably be rewritten
to do without it, using the GNU “date†command instead...