import (
"bytes"
"os"
- "path"
"path/filepath"
"strings"
jww.FATAL.Fatalln("theme name needs to be provided")
}
- createpath := helpers.AbsPathify(path.Join("themes", args[0]))
+ createpath := helpers.AbsPathify(filepath.Join("themes", args[0]))
jww.INFO.Println("creating theme at", createpath)
if x, _ := helpers.Exists(createpath, hugofs.SourceFs); x {
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
`)
- err := helpers.WriteToDisk(path.Join(createpath, "LICENSE.md"), bytes.NewReader(by), hugofs.SourceFs)
+ err := helpers.WriteToDisk(filepath.Join(createpath, "LICENSE.md"), bytes.NewReader(by), hugofs.SourceFs)
if err != nil {
jww.FATAL.Fatalln(err)
}
}
func mkdir(x ...string) {
- p := path.Join(x...)
+ p := filepath.Join(x...)
err := os.MkdirAll(p, 0777) // rwx, rw, r
if err != nil {
}
func touchFile(x ...string) {
- inpath := path.Join(x...)
+ inpath := filepath.Join(x...)
mkdir(filepath.Dir(inpath))
err := helpers.WriteToDisk(inpath, bytes.NewReader([]byte{}), hugofs.SourceFs)
if err != nil {
return err
}
- err = helpers.WriteToDisk(path.Join(inpath, "theme.toml"), bytes.NewReader(by), hugofs.SourceFs)
+ err = helpers.WriteToDisk(filepath.Join(inpath, "theme.toml"), bytes.NewReader(by), hugofs.SourceFs)
if err != nil {
return
}
return err
}
- err = helpers.WriteToDisk(path.Join(inpath, "config."+kind), bytes.NewReader(by), hugofs.SourceFs)
+ err = helpers.WriteToDisk(filepath.Join(inpath, "config."+kind), bytes.NewReader(by), hugofs.SourceFs)
if err != nil {
return
}