Make custom-project work on hikari

I've a different folder structure there.
This commit is contained in:
Daniel Siepmann 2023-02-18 11:22:18 +01:00
parent c9ce9b957b
commit 6b31c8a6d4
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
2 changed files with 13 additions and 7 deletions

View file

@ -67,7 +67,9 @@ with pkgs; [
# Use in conjuncion with https://github.com/autozimu/LanguageClient-neovim # Use in conjuncion with https://github.com/autozimu/LanguageClient-neovim
# rnix-lsp # rnix-lsp
(callPackage ./packages/custom/project { }) (callPackage ./packages/custom/project {
inherit ownLib;
})
# Communication # Communication
signal-desktop signal-desktop

View file

@ -1,10 +1,15 @@
{ {
writeShellApplication, writeShellApplication,
bash, bash,
gnused gnused,
ownLib
}: }:
writeShellApplication { let
positionOfCustomerName = if ownLib.onHikari {} then "5" else "7";
in writeShellApplication {
name = "custom-project"; name = "custom-project";
runtimeInputs = [ runtimeInputs = [
@ -23,7 +28,7 @@ writeShellApplication {
windowId=0 windowId=0
projectName="$1" projectName="$1"
customerName="$(pwd | cut -d'/' -f 7)" customerName="$(pwd | cut -d'/' -f ${positionOfCustomerName})"
projectRoot="$(pwd)/$projectName" projectRoot="$(pwd)/$projectName"
editorPath="$projectRoot" editorPath="$projectRoot"
databaseName="''${customerName}_''${projectName}" databaseName="''${customerName}_''${projectName}"
@ -78,12 +83,11 @@ writeShellApplication {
tmux send-keys -t "$session:$windowId" "cd $editorPath" C-m tmux send-keys -t "$session:$windowId" "cd $editorPath" C-m
tmux send-keys " renice -n 5 \$\$" C-m tmux send-keys " renice -n 5 \$\$" C-m
if [ "$databaseName" != "" ]; then if [ "$databaseName" != "" ]; then
tmux send-keys "mycli -u admin -D $databaseName" C-m tmux send-keys "mycli -u daniels -D $databaseName" C-m
else else
tmux send-keys "mycli -u admin -D " tmux send-keys "mycli -u daniels -D "
fi fi
tmux send-keys C-l tmux send-keys C-l
tmux select-pane -t 0
(( "windowId+=1" )) (( "windowId+=1" ))
# Open export folder # Open export folder