Created
July 9, 2017 06:03
-
-
Save triplefox/eba29cc7eeff1617ae319743fe6b727e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# initialize a new allegro-pascal project | |
my $projectname = "newproject"; | |
my $allegropas-src = "allegro.pas-5.2.a3-src-pas/lib"; | |
if $projectname.IO.e { | |
say "project $projectname already exists"; | |
} else { | |
mkdir $projectname or die "$!"; | |
try { | |
CATCH { | |
rmdir $projectname; | |
die "$_!"; | |
} | |
my @filelist = dir $allegropas-src; | |
for @filelist { | |
my $relpath = $_.relative($allegropas-src); | |
copy $_, $projectname.IO.add($relpath); | |
} | |
say "created project $projectname"; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is no need for
or die "$!"
as that is what happens whenmkdir
is in sink context.