Skip to content

Commit

Permalink
Item13428: Add a manual file option
Browse files Browse the repository at this point in the history
So this can be run to commit files from foswiki.org that were web
updated.
  • Loading branch information
gac410 committed May 23, 2015
1 parent 04c0f13 commit 62ec3ef
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions core/tools/develop/git-fix-meta.pl
@@ -1,6 +1,6 @@
#! /usr/bin/env perl
#
# git-fix-meta.pl
# git-fix-meta.pl [path/to/file1] [path/to/file2]
#
# Run this script from the root of your checkout. It lists all modified
# files, and makes the following fixups to the topic metadata
Expand All @@ -11,11 +11,30 @@
# - Converts autoattached files to hidden attachments
# - Adds a user= when missing from attachments.
#
my @files = `git status -uno --porcelain`;
# If run with one or more optional filenames, the git status command is omitted
# and the named files are updated.
#

use warnings;
use strict;

my $gitstatus;
my @files;

if (@ARGV) {
@files = @ARGV;
$gitstatus = 0;
}
else {
@files = `git status -uno --porcelain`;
$gitstatus = 1;
}

foreach my $f (@files) {
chomp $f;
$f = substr( $f, 3 );
if ($gitstatus) {
chomp $f;
$f = substr( $f, 3 );
}
next
unless $f =~
/data\/(?:System|Sandbox|TestCases|Main|_empty|_default|Trash|TWiki)\/.*?\.txt$/;
Expand Down

0 comments on commit 62ec3ef

Please sign in to comment.