root directory, or a user-specified folder relative to it.
Aliases are defined in .nuggit/config.json as the "aliases" object, or via the NGT_ALIASES environment variable. At present, this file must
the shell if the command exits without an error.
=back
=head1 EXAMPLE
Define a .nuggit.config.json file containing
{
"aliases" : {
"dkrbuild" : "docker run -it -v ${PWD}:/src:delegate
4.00 qw(coloralias);
use Git::Nuggit::Log;
use Cwd qw(getcwd);
use IPC::Run3;
use File::Spec;
use JSON;
use File::Slurp qw(read_file write_file);
our @ISA = qw(Exporter);
our @EXPORT = qw(get_submodu
= shift;
my $key = shift;
my $val = shift;
$self->{cfg} = $self->load_config("config.json",{}) unless defined($self->{cfg});
return undef unless $self->{cfg};
if (defined($val))
n) {
my $raw = read_file($fn);
return $default unless $raw;
return decode_json($raw);
} else {
return $default;
}
}
sub save_config {
my $self = shift;
se lib $FindBin::Bin.'/../lib'; # Add local lib to path
use Git::Nuggit;
use Term::ANSIColor;
use JSON;
use Data::Dumper; # DEBUG
my $opts = {
"verbose" => 0,
"ngtstrategy" => 'ref', # Origi
# Optional explicit alternative to nameless spec
"json!", # If set, output obj in JSON format (intended for usage with future UI wrapper)
ee($opts->{branch}, $opts->{branch2});
}
# Display results
if ($opts->{json}) {
say encode_json(\@objs);
} elsif ($opts->{patch}) {
foreach my $obj (@objs) {
--uno | -u
Ignore untracked files
=item --ignored
Show ignored files
=item --json
Show raw status structure in JSON format.
=item --conflicts | -c
Filter status output to show submodule summari
my $verbose = 0;
my $do_dump = 0; # Output Dumper() of raw status (debug-only)
my $do_json = 0; # Output in JSON format
my $flags = {
"uno" => 0, # If set, ignore untracked objects (git
u!" => \$flags->{uno},
"ignored!" => \$flags->{ignored},
'dump' => \$do_dump,
'json' => \$do_json,
'all|a!' => \$flags->{all},
'details|d!' => \$flags->{details},
'conflicts|c'
=head1 Internal Configuration Format
Nuggit stash configuration is saved to .nuggit/stash in a JSON file containing an object as described below.
Note: This is NOT considered a user configuration
ng;
use Pod::Usage;
use Cwd qw(getcwd);
use Term::ANSIColor;
use File::Spec;
use Git::Nuggit;
use JSON;
use Data::Dumper;
=head1 SYNOPSIS
List or create branches.
To create a branch, "ngt branch BR
sts in a submodule but not in the root repository. This will also accept the following flags: --json, --all.
=item --orphan
This argument must specify a branch name and an additional flag. If no
;
my $exists_in_flag = 0;
my $missing_from_flag = 0;
my $verbose = 0;
my $show_json = 0;
my $selected_branch = undef;
my $do_branch_list = 0;
# print "nuggit_branch.pl\n";
ParseAr
ge-tree command, with added submodule recursion.
=head1 Options
=over 4
=item B<--json>
Output results in a JSON format for parsing, or piping to a future UI. This implies '--full'
=item B<--full