diff options
author | avi <hi@avi.im> | 2016-12-22 13:09:58 +0530 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-12-22 09:33:08 +0100 |
commit | b2687ab1f7699cbb5ac183f49be67c2ab23d0a6f (patch) | |
tree | c7eca711912556dfae08e63f13c341603414c695 /commands/hugo.go | |
parent | 4845a13c9e0661496878b7c7d82172e3f4a3fbde (diff) |
command: Add `themesDir` command argument to specify themes directory
Diffstat (limited to 'commands/hugo.go')
-rw-r--r-- | commands/hugo.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/commands/hugo.go b/commands/hugo.go index f5f5ef462..153980cb1 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -146,6 +146,7 @@ var ( destination string logFile string theme string + themesDir string source string ) @@ -219,6 +220,7 @@ func initHugoBuildCommonFlags(cmd *cobra.Command) { cmd.Flags().BoolP("ignoreCache", "", false, "Ignores the cache directory") cmd.Flags().StringVarP(&destination, "destination", "d", "", "filesystem path to write files to") cmd.Flags().StringVarP(&theme, "theme", "t", "", "theme to use (located in /themes/THEMENAME/)") + cmd.Flags().StringVarP(&themesDir, "themesDir", "", "", "filesystem path to themes directory") cmd.Flags().Bool("uglyURLs", false, "if true, use /filename.html instead of /filename/") cmd.Flags().Bool("canonifyURLs", false, "if true, all relative URLs will be canonicalized using baseURL") cmd.Flags().StringVarP(&baseURL, "baseURL", "b", "", "hostname (and path) to the root, e.g. http://spf13.com/") @@ -287,6 +289,10 @@ func InitializeConfig(subCmdVs ...*cobra.Command) error { viper.Set("theme", theme) } + if themesDir != "" { + viper.Set("themesDir", themesDir) + } + if destination != "" { viper.Set("publishDir", destination) } |