Skip to content

Commit

Permalink
command: Add themesDir command argument to specify themes directory
Browse files Browse the repository at this point in the history
  • Loading branch information
avinassh authored and bep committed Dec 22, 2016
1 parent 4845a13 commit b2687ab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions commands/hugo.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ var (
destination string
logFile string
theme string
themesDir string
source string
)

Expand Down Expand Up @@ -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/")
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit b2687ab

Please sign in to comment.