From 509cf6c1f4512feb536e1daf3a9922ba604ff253 Mon Sep 17 00:00:00 2001 From: Key Date: Thu, 6 Oct 2022 23:17:01 +0000 Subject: [PATCH] Add bash and sh default config --- README.md | 32 ++++++++++++++++++-------------- pkg/config/default.go | 32 ++++++++++++++++++-------------- 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 032289d..9d05baa 100644 --- a/README.md +++ b/README.md @@ -222,32 +222,36 @@ You can display the default YAML configuration by running `gaze -y`. ```yaml commands: - - ext: .go - cmd: go run "{{file}}" - - ext: .py - cmd: python "{{file}}" - - ext: .rb - cmd: ruby "{{file}}" - - ext: .js - cmd: node "{{file}}" + - ext: .bash + cmd: bash "{{file}}" + - ext: .cpp + cmd: | + gcc "{{file}}" -o"{{base0}}.out" + ./"{{base0}}.out" - ext: .d cmd: dmd -run "{{file}}" + - ext: .go + cmd: go run "{{file}}" - ext: .groovy cmd: groovy "{{file}}" - - ext: .php - cmd: php "{{file}}" - ext: .java cmd: java "{{file}}" + - ext: .js + cmd: node "{{file}}" - ext: .kts cmd: kotlinc -script "{{file}}" + - ext: .php + cmd: php "{{file}}" + - ext: .py + cmd: python "{{file}}" + - ext: .rb + cmd: ruby "{{file}}" - ext: .rs cmd: | rustc "{{file}}" -o"{{base0}}.out" ./"{{base0}}.out" - - ext: .cpp - cmd: | - gcc "{{file}}" -o"{{base0}}.out" - ./"{{base0}}.out" + - ext: .sh + cmd: sh "{{file}}" - ext: .ts cmd: | tsc "{{file}}" --out "{{base0}}.out" diff --git a/pkg/config/default.go b/pkg/config/default.go index 6834b31..eb91895 100644 --- a/pkg/config/default.go +++ b/pkg/config/default.go @@ -10,32 +10,36 @@ package config func Default() string { return `# Gaze configuration(priority: default < ~/.gaze.yml < ~/.config/gaze/gaze.yml < -f option) commands: -- ext: .go - cmd: go run "{{file}}" -- ext: .py - cmd: python "{{file}}" -- ext: .rb - cmd: ruby "{{file}}" -- ext: .js - cmd: node "{{file}}" +- ext: .bash + cmd: bash "{{file}}" +- ext: .cpp + cmd: | + gcc "{{file}}" -o"{{base0}}.out" + ./"{{base0}}.out" - ext: .d cmd: dmd -run "{{file}}" +- ext: .go + cmd: go run "{{file}}" - ext: .groovy cmd: groovy "{{file}}" -- ext: .php - cmd: php "{{file}}" - ext: .java cmd: java "{{file}}" +- ext: .js + cmd: node "{{file}}" - ext: .kts cmd: kotlinc -script "{{file}}" +- ext: .php + cmd: php "{{file}}" +- ext: .py + cmd: python "{{file}}" +- ext: .rb + cmd: ruby "{{file}}" - ext: .rs cmd: | rustc "{{file}}" -o"{{base0}}.out" ./"{{base0}}.out" -- ext: .cpp - cmd: | - gcc "{{file}}" -o"{{base0}}.out" - ./"{{base0}}.out" +- ext: .sh + cmd: sh "{{file}}" - ext: .ts cmd: | tsc "{{file}}" --out "{{base0}}.out"