-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerator.pl
executable file
·42 lines (32 loc) · 977 Bytes
/
generator.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env perl
use strict;
use warnings;
use File::Path;
use File::Basename;
use File::Spec;
use Getopt::Long;
use Cwd;
my $perl = $^X;
my $verbose;
my $output;
GetOptions(
'output=s' => \$output,
'verbose' => \$verbose
);
print("[", $$, "] Generator (", scalar @ARGV, "): ", $_, "\n") for (@ARGV);
my $outputPath = File::Spec->rel2abs($output);
mkpath($outputPath);
foreach my $argument (@ARGV) {
my $headerPathToWrite = $outputPath . "/JS" . basename($argument, ".serialized") . ".h";
open(FH, '>', $headerPathToWrite) or die $!;
print(FH $headerPathToWrite);
close(FH);
print("[", $$, "] Generator wrote out: ", $headerPathToWrite, "\n");
my $cppPathToWrite = $outputPath . "/JS" . basename($argument, ".serialized") . ".cpp";
open(FH, '>', $cppPathToWrite) or die $!;
print(FH $cppPathToWrite);
close(FH);
print("[", $$, "] Generator wrote out: ", $cppPathToWrite, "\n");
}
print("\n");
exit 0;