Unverified Commit 56ce89fe authored by David Fifield's avatar David Fifield Committed by boklm
Browse files

Bug 28771: Port get_hg_hash to Path::Tiny and note JSON dependency in README.

parent 2e1d3917
......@@ -26,6 +26,7 @@ You also need a few perl modules installed:
- Template
- IO::Handle
- IO::CaptureOutput
- JSON
- File::Temp
- Path::Tiny
- File::Path
......@@ -40,7 +41,7 @@ If you are running Debian or Ubuntu, you can install them with:
# apt-get install libyaml-libyaml-perl libtemplate-perl \
libio-handle-util-perl libio-all-perl \
libio-captureoutput-perl libpath-tiny-perl \
libio-captureoutput-perl libjson-perl libpath-tiny-perl \
libstring-shellquote-perl libsort-versions-perl \
libdigest-sha-perl libdata-uuid-perl libdata-dump-perl \
libfile-copy-recursive-perl git libgtk2.0-dev curl runc \
......
#!/usr/bin/perl -w
use strict;
use File::Slurp;
use Path::Tiny;
use JSON;
sub exit_error {
......@@ -11,7 +11,7 @@ sub exit_error {
exit_error("Wrong number of arguments", 1) unless @ARGV == 2;
my ($file, $locale) = @ARGV;
my $json_text = read_file($file);
my $json_text = path($file)->slurp_raw;
exit_error("Error reading $file", 2) unless defined $json_text;
my $data = decode_json($json_text);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment