diff --git a/README.md b/README.md index 5642052..44b654b 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ ccat is a file printing tool (like 'cat') which uses Regular Expressions to enab - Highly extensible - to add a config file for an specific file type, name the file `.conf`. - Support for printing line numbers with the `-n` flag. - Statically linked Go binary - no runtime dependencies, config files are distributed along with the binary. -- Cross-platform +- Linux and MacOS supported. --- @@ -32,7 +32,7 @@ The following languages have config files included by default: --- ### Getting Started -The config files are embedded within the binary. They will automatically be installed to the correct location (`%APPDATA/ccat` on Windows, `~/.config/ccat` on UNIX) when the program is first run. +The config files are embedded within the binary. They will automatically be installed to the correct location (`~/.config/ccat` on UNIX) when the program is first run. As written above, if provided a file with extension `.example`, the program will look for the config file named `example.conf`. If such a file doesn't exist, the file is printed out without any highlighting. @@ -61,5 +61,6 @@ Note that the color name must be capitalized (and shouldn't contain spaces). The --- ### TODO: +- Windows support. - Allow users to provide a config file in the command-line, overriding the extension-based config file. - Provide releases. diff --git a/create_release_builds.sh b/create_release_builds.sh index cd4e38d..998348d 100755 --- a/create_release_builds.sh +++ b/create_release_builds.sh @@ -2,7 +2,7 @@ set -euo pipefail -POSSIBLE_GOOS=( "windows" "linux" "darwin" ) +POSSIBLE_GOOS=( "linux" "darwin" ) POSSIBLE_GOARCH=( "amd64" "arm64" ) for OS in "${POSSIBLE_GOOS[@]}"; do diff --git a/main.go b/main.go index 5291ff2..c417c80 100644 --- a/main.go +++ b/main.go @@ -78,17 +78,11 @@ func main() { flag.Parse() // Check if config exists. If it doesn't, generate the config files. - var configPath string // Location of config files, depends on OS currentUser, err := user.Current() // Get current user, to determine config path if err != nil { panic(err) } - if runningOnWindows() { - configPath = filepath.Join("C:\\Users" + currentUser.Username + "AppData\\Local\\ccat\\") - } else { - - configPath = filepath.Join("/home/" + currentUser.Username + "/.config/ccat/") - } + configPath := filepath.Join("/home/" + currentUser.Username + "/.config/ccat/") if _, err := os.Stat(configPath); os.IsNotExist(err) { generateDefaultConfigs(configPath) }