Skip to content

Instantly share code, notes, and snippets.

@cherryramatisdev
Created September 11, 2023 22:57
Show Gist options
  • Save cherryramatisdev/19f232522f3eb740498538bb7a9974b1 to your computer and use it in GitHub Desktop.
Save cherryramatisdev/19f232522f3eb740498538bb7a9974b1 to your computer and use it in GitHub Desktop.
#!/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