non important commit
This commit is contained in:
parent
2b909bfb6a
commit
4320816d34
1 changed files with 25 additions and 20 deletions
|
|
@ -1,10 +1,12 @@
|
|||
{pkgs, ...}: {
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
blueprints = ./. + "/project-blueprints";
|
||||
in {
|
||||
home.packages = [
|
||||
(pkgs.writeScriptBin "create-project"
|
||||
/*
|
||||
nu
|
||||
*/
|
||||
''
|
||||
(pkgs.writeScriptBin "create-project" ''
|
||||
#!${pkgs.nushell}/bin/nu
|
||||
|
||||
def main [
|
||||
|
|
@ -12,6 +14,7 @@
|
|||
name?: string
|
||||
--local (-l)
|
||||
] {
|
||||
|
||||
if $name == null or $type == null {
|
||||
print "Usage: create-project <name> <type> [Options: -l]"
|
||||
exit 1
|
||||
|
|
@ -27,7 +30,9 @@
|
|||
exit 1
|
||||
}
|
||||
|
||||
if ($"~/.nix-config/home/modules/create-project/project-blueprints/($type)" | path type) != "dir" {
|
||||
let blueprint_dir = "${blueprints}/($type)"
|
||||
|
||||
if ($blueprint_dir | path type) != "dir" {
|
||||
print "This project type doesn't exist"
|
||||
exit 1
|
||||
}
|
||||
|
|
@ -35,12 +40,12 @@
|
|||
mkdir $name
|
||||
cd $name
|
||||
|
||||
if ($"~/.nix-config/home/modules/create-project/project-blueprints/($type)" | path expand | ls $in | length) > 0 {
|
||||
glob $"~/.nix-config/home/modules/create-project/project-blueprints/($type)/*" | each { |file| cp $file . }
|
||||
if ($blueprint_dir | path expand | ls $in | length) > 0 {
|
||||
glob $"($blueprint_dir)/*" | each { |file| cp $file . }
|
||||
}
|
||||
|
||||
if ($"./init.sh" | path type) == "file" {
|
||||
bash $"./init.sh" $name
|
||||
if ("./init.sh" | path type) == "file" {
|
||||
bash "./init.sh" $name
|
||||
rm "init.sh"
|
||||
}
|
||||
|
||||
|
|
@ -56,7 +61,7 @@
|
|||
exit 0
|
||||
}
|
||||
|
||||
${pkgs.tea} repos create --name $name
|
||||
${lib.getExe pkgs.tea} repos create --name $name
|
||||
git remote add origin $"https://git.stribrny.org/max_ag/($name).git"
|
||||
git push -u origin main
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue