mirror of
https://github.com/Cian-H/dotfiles.git
synced 2025-12-26 04:41:58 +00:00
This change allows the dotfiles to work with chezmoi (e.g: on windows) and improves grepability with neovim/telescope
28 lines
761 B
Nu
28 lines
761 B
Nu
# 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
|
|
}
|