initrc

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InitrcCmd = &cobra.Command{
	Use:   "initrc",
	Short: "init rc is command to invoke the activated bashrc",
	Run: func(cmd *cobra.Command, args []string) {

		fp := getCurrentExePath()
		reload_func := fmt.Sprintf(`
function SSS_RELOAD () {
	source <(%v initrc --reload=true)
}
`, fp)
		fmt.Println(reload_func)

		if os.Getenv("SSS_LOADED") == "true" && !reload {

			return
		}
		fmt.Println("export SSS_LOADED=true;")
		cmd_impel.InitRC()
	},
}
View Source
var InstallCmd = &cobra.Command{
	Use:   "install",
	Short: "output how to use this cli in rc files",
	Run: func(cmd *cobra.Command, args []string) {
		fp := getCurrentExePath()
		log.Infoln("using following command to add into zshrc:")
		log.Infof(`	echo 'source <(%v initrc)' >> ~/.zshrc `, fp)
		log.Infoln("using following command to add into bashrc:")
		log.Infof(`	echo 'source <(%v initrc)' >> ~/.bashrc `, fp)
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL