mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
- Introduced a new utility function to print a logo and welcome information for the Crawlab server, enhancing user experience during startup. - Updated logger variable names in the apps package for consistency and clarity. - Added a new dependency on github.com/common-nighthawk/go-figure to facilitate logo rendering. - Improved the server command to display the logo when the server starts, provided the user is not using the pro version.
31 lines
606 B
Go
31 lines
606 B
Go
package cmd
|
|
|
|
import (
|
|
"github.com/crawlab-team/crawlab/core/apps"
|
|
"github.com/crawlab-team/crawlab/core/utils"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(serverCmd)
|
|
}
|
|
|
|
var serverCmd = &cobra.Command{
|
|
Use: "server",
|
|
Aliases: []string{"s"},
|
|
Short: "Start Crawlab server",
|
|
Long: `Start Crawlab node server that can serve as API, task scheduler, task runner, etc.`,
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
// print logo if not pro
|
|
if !utils.IsPro() {
|
|
utils.PrintLogoWithWelcomeInfo()
|
|
}
|
|
|
|
// app
|
|
svr := apps.GetServer()
|
|
|
|
// start
|
|
apps.Start(svr)
|
|
},
|
|
}
|