-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
35 lines (31 loc) · 751 Bytes
/
Copy pathmain.go
File metadata and controls
35 lines (31 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Command spin is a language-agnostic scaffolder for external
// templates. `spin new <name> [<template>]` scaffolds a project
// from any git repo, local path, or pinned template that has a
// spin.toml + _base/ tree. No built-in templates.
package main
import (
"context"
"errors"
"fmt"
"os"
"charm.land/fang/v2"
"github.com/sam0uly/spin/cmd"
"github.com/sam0uly/spin/internal/theme"
"github.com/sam0uly/spin/internal/version"
)
func main() {
err := fang.Execute(
context.Background(),
cmd.RootCmd(),
fang.WithVersion(version.Version),
fang.WithColorSchemeFunc(theme.FangColorScheme),
)
if err == nil {
return
}
if errors.Is(err, cmd.ErrCancelled) {
fmt.Fprintln(os.Stderr, err.Error())
os.Exit(130)
}
os.Exit(1)
}