Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

place a placeholder for $VERSION in help text and replace it when displaying usage #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion git-store-meta.pl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
# gid group ID (if group is also set, prefer group and fallback to gid)
# acl access control lists for POSIX setfacl/getfacl
#
# git-store-meta 2.3.7
# git-store-meta $VERSION
# Copyright (c) 2015-2023, Danny Lin
# Released under MIT License
# Project home: https://github.com/danny0838/git-store-meta
Expand Down Expand Up @@ -584,6 +584,8 @@ sub setfacl_external {
# with "# " removed
sub usage {
my $start = 0;
my $version = $VERSION;
$version =~ s/^v//; # remove optional starting 'v'
open(GIT_STORE_META, "<:crlf", $script)
or die "error: failed to access `$script': $!\n";
while (<GIT_STORE_META>) {
Expand All @@ -593,6 +595,7 @@ sub usage {
}
next if !$start;
s/^# ?//;
s/\$VERSION/$version/; # replace $VERSION with actual version
print;
}
close(GIT_STORE_META);
Expand Down