mirror of
https://github.com/Cian-H/dotfiles.git
synced 2026-01-07 01:22:04 +00:00
Changed . token to _dot
This change allows the dotfiles to work with chezmoi (e.g: on windows) and improves grepability with neovim/telescope
This commit is contained in:
27
dot_config/nushell/nu_scripts/sourced/run-c-cpp.nu
Normal file
27
dot_config/nushell/nu_scripts/sourced/run-c-cpp.nu
Normal file
@@ -0,0 +1,27 @@
|
||||
# Runs C code via GCC without leaving a file behind
|
||||
def rcc [
|
||||
file: path # The file to run
|
||||
] {
|
||||
# Remove exe if still exists
|
||||
rm $"($file).exe" --permanent --force
|
||||
# Compile code to exe
|
||||
^gcc ("." | path join $file | path expand) -o ("." | path join $"($file).exe" | path expand)
|
||||
# Execute exe
|
||||
^$"($file).exe"
|
||||
# Remove exe
|
||||
rm $"($file).exe" --permanent --force
|
||||
}
|
||||
|
||||
# Runs C++ code via g++ without leaving a file behind
|
||||
def r++ [
|
||||
file: path # The file to run
|
||||
] {
|
||||
# Remove exe if still exists
|
||||
rm $"($file).exe" --permanent --force
|
||||
# Compile code to exe
|
||||
^g++ ("." | path join $file | path expand) -o ("." | path join $"($file).exe" | path expand)
|
||||
# Execute exe
|
||||
^$"($file).exe"
|
||||
# Remove exe
|
||||
rm $"($file).exe" --permanent --force
|
||||
}
|
||||
Reference in New Issue
Block a user