Created
September 11, 2023 22:57
-
-
Save cherryramatisdev/19f232522f3eb740498538bb7a9974b1 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use v5.14; | |
my $arg = $ARGV[0]; | |
if ( defined $arg ) { | |
chdir $arg or die "Failed to change directory to $arg: $!"; | |
} | |
my $dev_cmd; | |
if ( -f ".projections.json" ) { | |
$dev_cmd = `jq -r '."*".make' .projections.json`; | |
} | |
if ( -f "nest-cli.json" ) { | |
$dev_cmd = "pkg start:dev"; | |
} | |
if ( -f "next.config.js" ) { | |
$dev_cmd = "pkg dev"; | |
} | |
if ( -f "Gemfile" ) { | |
if ( -f "bin/rails" ) { | |
$dev_cmd = "rails s"; | |
} | |
else { | |
$dev_cmd = "bin/console"; | |
} | |
} | |
system("tmux neww -d $dev_cmd") if defined $dev_cmd; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment