#!/usr/bin/perl use strict; use FindBin qw($Bin); use Getopt::Long; sub usage { die "Usage: dev-appengine [--wipe] [-a] [-p port] -- [other_dev_appserver_opts]"; } my $opt_wipe; my $opt_port; my $opt_all; # listen on all interfaces GetOptions("wipe" => \$opt_wipe, "all" => \$opt_all, "p=i" => \$opt_port, ) or usage(); my $sdk = readlink("$Bin/appengine-sdk") or die "No App Engine SDK symlink; please:\n \$ ln -s /path/to/appengine-go-sdk $Bin/appengine-sdk\n\n"; my @args = ( "$sdk/dev_appserver.py", "--skip_sdk_update_check", ); if ($opt_all) { push @args, "-a", "0.0.0.0"; } if ($opt_wipe) { push @args, "--clear_datastore"; } if ($opt_port) { push @args, "--port", "$opt_port"; } else { push @args, "--port", "3179"; } push @args, @ARGV; chdir "$Bin/server/appengine" or die "$!"; push @args, "."; print "\$ @args\n"; exec(@args);