Files
llgo/compiler/cmd/internal/install/install.go

47 lines
1.3 KiB
Go
Raw Normal View History

2023-12-11 09:53:40 +08:00
/*
2024-04-24 07:55:51 +08:00
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
2023-12-11 09:53:40 +08:00
*
* 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.
*/
2024-04-25 01:41:44 +08:00
// Package install implements the "llgo install" command.
2024-04-24 07:55:51 +08:00
package install
2023-12-11 09:53:40 +08:00
2024-04-23 00:47:38 +08:00
import (
"fmt"
"os"
2025-01-07 21:49:08 +08:00
"github.com/goplus/llgo/compiler/cmd/internal/base"
"github.com/goplus/llgo/compiler/internal/build"
2025-01-14 10:50:43 +08:00
"github.com/goplus/llgo/compiler/internal/mockable"
2024-04-23 00:47:38 +08:00
)
2024-04-24 07:55:51 +08:00
// llgo install
var Cmd = &base.Command{
UsageLine: "llgo install [build flags] [packages]",
Short: "Compile and install packages and dependencies",
2023-12-11 09:53:40 +08:00
}
2024-04-24 07:55:51 +08:00
func init() {
Cmd.Run = runCmd
2024-04-23 00:47:38 +08:00
}
2024-04-24 07:55:51 +08:00
func runCmd(cmd *base.Command, args []string) {
2024-04-25 00:53:42 +08:00
conf := build.NewDefaultConf(build.ModeInstall)
_, err := build.Do(args, conf)
if err != nil {
fmt.Fprintln(os.Stderr, err)
2025-01-14 10:50:43 +08:00
mockable.Exit(1)
}
2024-04-24 07:55:51 +08:00
}