Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
.DS_Store

# ide
.idea/**
.vscode/**
**/.idea/
.idea/
.vscode/

target/*

Expand Down
26 changes: 26 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,32 @@ builds:
- -trimpath
- -gcflags=-l -B

- main: ./cmd/ts-cli
id: ts-cli-full
binary: ts-cli-full
tags: [full]
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
ignore:
- goos: windows
goarch: arm64
ldflags:
- -s -w
- -X github.com/openGemini/openGemini-cli/common.Version={{.Tag}}
- -X github.com/openGemini/openGemini-cli/common.GitCommit={{.ShortCommit}}
- -X github.com/openGemini/openGemini-cli/common.BuildTime={{.Date}}
- -X github.com/openGemini/openGemini-cli/common.GitBranch={{.Branch}}
flags:
- -trimpath
- -gcflags=-l -B

archives:
- formats: [ 'zip' ]
# this name template makes the OS and Arch compatible with the results of `uname`.
Expand Down
23 changes: 23 additions & 0 deletions cmd/subcmd/export_dispatcher_default.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright 2025 openGemini Authors
//
// 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.

//go:build !full
// +build !full

package subcmd

// Run executes the export command (online mode only in default build)
func (c *ExportCommand) Run(config *ExportConfig) error {
return c.runOnlineExport(config)
}
28 changes: 28 additions & 0 deletions cmd/subcmd/export_dispatcher_full.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2025 openGemini Authors
//
// 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.

//go:build full
// +build full

package subcmd

// Run executes the export command (supports both online and offline modes in full build)
func (c *ExportCommand) Run(config *ExportConfig) error {
useOffline := config.DataDir != "" || config.WalDir != ""

if useOffline {
return c.runOfflineExport(config)
}
return c.runOnlineExport(config)
}
Loading