Update install script to handle .config

This commit is contained in:
Sangelo 2023-03-06 19:53:08 +01:00
parent 6131b3ca58
commit 708cab5804
4 changed files with 57 additions and 0 deletions

View file

@ -33,6 +33,8 @@ nim c -o:bin/niminit niminit
This will create a directory called ``bin/`` inside the repo. You can copy the binary into your path from there. This will create a directory called ``bin/`` inside the repo. You can copy the binary into your path from there.
You'll also find two template files that can be used to initialise a nim project for VSCode inside ``config`` in this repo. You can copy these to ``~/.config/niminit`` or create your own.
## Update ## Update
1. Open your terminal and ``cd`` into the repository. 1. Open your terminal and ``cd`` into the repository.
2. Run ``git pull`` to update the local repo. 2. Run ``git pull`` to update the local repo.

14
config/launch.json Normal file
View file

@ -0,0 +1,14 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "nim: debug current file",
"preLaunchTask": "nim: build current file (for debugging)",
"program": "${workspaceFolder}/bin/${fileBasenameNoExtension}",
"args": [],
"cwd": "${workspaceFolder}"
}
]
}

37
config/tasks.json Normal file
View file

@ -0,0 +1,37 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "nim: build current file",
"command": "nim",
"args": [
"c",
"-o:${workspaceRoot}/bin/${fileBasenameNoExtension}",
"-r", "${fileBasename}"
],
"options": {
"cwd": "${workspaceRoot}"
},
"type": "shell",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "nim: build current file (for debugging)",
"command": "nim",
"args": [
"c",
"-g",
"--debugger:native",
"-o:${workspaceRoot}/bin/${fileBasenameNoExtension}",
"${relativeFile}"
],
"options": {
"cwd": "${workspaceRoot}"
},
"type": "shell"
}
]
}

View file

@ -12,6 +12,10 @@ mkdir -p $HOME/.local/bin
# Copy binary to local bin folder # Copy binary to local bin folder
cp bin/niminit $HOME/.local/bin/niminit cp bin/niminit $HOME/.local/bin/niminit
# Create config directory & copy files
mkdir -p $HOME/.config/niminit
cp config/* $HOME/.config/niminit
# Print info message to export local bin if not already # Print info message to export local bin if not already
echo -e "\n" echo -e "\n"
echo -e "\e[92m>>> \e[0mDone! If you haven't already added your local bin folder to your PATH, you can do so by adding the following line to your .profile, .bashrc or .zshrc" echo -e "\e[92m>>> \e[0mDone! If you haven't already added your local bin folder to your PATH, you can do so by adding the following line to your .profile, .bashrc or .zshrc"