diff --git a/.config/bash/module/Archive.sh b/.config/bash/module/Archive.sh index 1d59fb3..4dd8628 100644 --- a/.config/bash/module/Archive.sh +++ b/.config/bash/module/Archive.sh @@ -248,6 +248,22 @@ function unarchive() { _iterate_targets process ${targets[@]} } +# Change archive's filesystem time to match creation date. +# Usage: archive_touch [FILES] +function archive_touch() { + local IFS=$'\n' + local targets=(${@}) + [[ "${targets}" = "" ]] && targets=$(_ls_archive) + + process() { + local data=($(_archive_parse "${target}")) + local date=${data[1]} + touch -t ${date} -- ${target} + } + + _iterate_targets process ${targets[@]} +} + # Parse archive file name to get: name, date, hash and format. # Usage: _archive_parse function _archive_parse() { diff --git a/.doc/Bash.md b/.doc/Bash.md index 339d6eb..2f231be 100644 --- a/.doc/Bash.md +++ b/.doc/Bash.md @@ -29,6 +29,7 @@ Command|Description `archive_xz [FILES]`|Recompress previously created archive_fast with better compression. `archive_name [ARCHIVE] [NAME]`|Rename archives. If no name specified, it simplifies archive's name. If no archives specified, apply to all archives. `unarchive [FILES]`|Extract previously created archive with checksum validation. +`archive_touch [FILES]`|Change archive's filesystem time to match creation date. ## Battery. @@ -43,7 +44,7 @@ Command|Description ---|--- `bootstrap_editorconfig`| Install Editorconfig file (with tabs) in current directory. `bootstrap_editorconfig_space [AMOUNT]`|Install Editorconfig file (with specified spaces, 8 by default) in current directory. -`bootstrap_flatpak`| Setup all the flatpak apps on the machine. +`bootstrap_nixos [HOST]`|Install nixos to specified drive. To be run from Live ISO. ## Cd. @@ -211,6 +212,7 @@ Command|Description `gu [EMAIL]`|Specify git user as Dmitry Voronin with provided email. `gg `|Get my git repo. `gdc `|See diff for a specific commit. +`gv`| Get version number based on commit count. ## Group. @@ -271,6 +273,7 @@ Command|Description `nix_prune`| Free up root space. `nix_shell [NAME]`|Spawn shell with specified nix environment. Uses flake.nix in current dir by default. `nix_tmpshell `|Spawn nix-shell with specified packages. +`nix_live`| Build live image. ## Notify.