Skip to content

Commit

Permalink
Add combiner as a cli tool
Browse files Browse the repository at this point in the history
  • Loading branch information
SEbbaDK committed Feb 15, 2022
1 parent 6fac8c8 commit b6cdb5d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 3 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ pkgs.stdenv.mkDerivation {
];

buildPhase = ''
crystal build marka.cr
crystal build --release --progress --verbose marka.cr
crystal build --release --progress --verbose marka-combiner.cr
'';

installPhase = ''
mkdir -p $out/bin
mv marka $out/bin/
mv marka-combiner $out/bin/
'';
}
16 changes: 16 additions & 0 deletions marka-combiner.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require "./combiner"

if ARGV.size != 1
STDERR.puts "A file to combine should be given as the only argument"
exit 1
end

begin
puts cat_file ARGV[1]
rescue ex : CompileException
STDERR.puts ex.error
ex.stack.each do |s|
STDERR.puts "in #{s[:file]}:#{s[:line]}"
end
exit 4
end

0 comments on commit b6cdb5d

Please sign in to comment.