Skip to content

Commit

Permalink
Made IPC::System::Simple optional
Browse files Browse the repository at this point in the history
  • Loading branch information
a3f committed Jun 18, 2015
1 parent 81b9caf commit 784d527
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions flash.pl
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
#!/usr/bin/perl
# stderr output can be filtered out on windows by appending 2> NUL to the line calling perl
$|++;
use IPC::System::Simple;
use autodie 'system';
use strict;
$|++;
eval "use autodie 'system';" if eval "use IPC::System::Simple;1;";


local $/ = '/';
my $name = $ARGV[0];

my $localBinary = "test$/" . $name;
my $remoteBinary = '../prjs/SD_Card/' . $name;
my $localLauncher = "test$/myapps$/". $name . 'Starter.rbf';
my $remoteLauncher = '../prjs/SD_Card/myapps/' . $name . 'Starter.rbf';
my $localBinary = "test/$name";
my $remoteBinary = "../prjs/SD_Card/$name";
my $localLauncher = "test/myapps/${name}Starter.rbf";
my $remoteLauncher = "../prjs/SD_Card/myapps/${name}Starter.rbf";

printf("\n1- Attempting getting binary <%s> to <%s>\n", $localBinary, $remoteBinary);
system(".$/ev3duder" , 'up', $localBinary, $remoteBinary);
system("./ev3duder" , 'up', $localBinary, $remoteBinary);

printf("\n2- Attempting getting starter <%s> to <%s>\n", $localLauncher, $remoteLauncher);
system(".$/ev3duder", 'up', $localLauncher, $remoteLauncher);
system("./ev3duder", 'up', $localLauncher, $remoteLauncher);

printf("\n3- Attempting start of starter <%s>\n", $remoteLauncher);
system(".$/ev3duder", 'exec', $remoteLauncher);
system("./ev3duder", 'run', $remoteLauncher);

printf("\n4- All is well!\n");

Expand Down

0 comments on commit 784d527

Please sign in to comment.