| 1 |
// Copyright 2024 The Hugo Authors. All rights reserved. |
| 2 |
// |
| 3 |
// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
// you may not use this file except in compliance with the License. |
| 5 |
// You may obtain a copy of the License at |
| 6 |
// http://www.apache.org/licenses/LICENSE-2.0 |
| 7 |
// |
| 8 |
// Unless required by applicable law or agreed to in writing, software |
| 9 |
// distributed under the License is distributed on an "AS IS" BASIS, |
| 10 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 |
// See the License for the specific language governing permissions and |
| 12 |
// limitations under the License. |
| 13 |
|
| 14 |
//go:build !withdeploy |
| 15 |
|
| 16 |
// Copyright 2024 The Hugo Authors. All rights reserved. |
| 17 |
// |
| 18 |
// Licensed under the Apache License, Version 2.0 (the "License"); |
| 19 |
// you may not use this file except in compliance with the License. |
| 20 |
// You may obtain a copy of the License at |
| 21 |
// http://www.apache.org/licenses/LICENSE-2.0 |
| 22 |
// |
| 23 |
// Unless required by applicable law or agreed to in writing, software |
| 24 |
// distributed under the License is distributed on an "AS IS" BASIS, |
| 25 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 26 |
// See the License for the specific language governing permissions and |
| 27 |
// limitations under the License. |
| 28 |
|
| 29 |
package commands |
| 30 |
|
| 31 |
import ( |
| 32 |
"context" |
| 33 |
"errors" |
| 34 |
|
| 35 |
"github.com/bep/simplecobra" |
| 36 |
"github.com/spf13/cobra" |
| 37 |
) |
| 38 |
|
| 39 |
func newDeployCommand() simplecobra.Commander { |
| 40 |
return &simpleCommand{ |
| 41 |
name: "deploy", |
| 42 |
run: func(ctx context.Context, cd *simplecobra.Commandeer, r *rootCommand, args []string) error { |
| 43 |
return errors.New("deploy not supported in this version of Hugo; install a release with 'withdeploy' in the archive filename or build yourself with the 'withdeploy' build tag. Also see https://github.com/gohugoio/hugo/pull/12995") |
| 44 |
}, |
| 45 |
withc: func(cmd *cobra.Command, r *rootCommand) { |
| 46 |
applyDeployFlags(cmd, r) |
| 47 |
cmd.Hidden = true |
| 48 |
}, |
| 49 |
} |
| 50 |
} |