forked from gohugoio/hugo
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes gohugoio#7644 Fixes gohugoio#7656
- Loading branch information
Showing
11 changed files
with
531 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright 2020 The Hugo Authors. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package commands | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/gohugoio/hugo/hugolib" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func newModNPMCmd(c *modCmd) *cobra.Command { | ||
|
||
cmd := &cobra.Command{ | ||
Use: "npm", | ||
Short: "Various npm helpers.", | ||
Long: `Various npm (Node package manager) helpers.`, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
return c.withHugo(func(h *hugolib.HugoSites) error { | ||
return nil | ||
}) | ||
}, | ||
} | ||
|
||
cmd.AddCommand(&cobra.Command{ | ||
Use: "pack", | ||
Short: "Experimental: Prepares and writes a composite package.json file for your project.", | ||
Long: `Prepares and writes a composite package.json file for your project. | ||
Note that this command will fail if there is already a "package.json" file in the project. | ||
If there is a file named "package.hugo.json", that file will be used as a template file | ||
with the base dependency set. | ||
This command is marked as 'Experimental'. We think it's a great idea, so it's not likely to be | ||
removed from Hugo, but we need to test this out in "real life" to get a feel of it, | ||
so this may/will change in future versions of Hugo. | ||
`, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
|
||
return c.withHugo(func(h *hugolib.HugoSites) error { | ||
fmt.Println("PACK", h) | ||
|
||
return nil | ||
|
||
}) | ||
}, | ||
}) | ||
|
||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.