func run(
	ctx context.Context,
	container appflag.Container,
) error {
	directoryInput, err := bufcli.GetInputValue(container, "", ".")
	if err != nil {
		return err
	}
	storageosProvider := storageos.NewProvider(storageos.ProviderWithSymlinks())
	readWriteBucket, err := storageosProvider.NewReadWriteBucket(
		directoryInput,
		storageos.ReadWriteBucketWithSymlinksIfSupported(),
	)
	if err != nil {
		return err
	}
	existingConfigFilePath, err := bufconfig.ExistingConfigFilePath(ctx, readWriteBucket)
	if err != nil {
		return err
	}
	if existingConfigFilePath == "" {
		return bufcli.ErrNoConfigFile
	}
	config, err := bufconfig.GetConfigForBucket(ctx, readWriteBucket)
	if err != nil {
		return err
	}
	var moduleIdentityString string
	if config.ModuleIdentity != nil {
		moduleIdentityString = config.ModuleIdentity.IdentityString()
	}
	if moduleIdentityString == "" {
		return fmt.Errorf("%s has no module name", existingConfigFilePath)
	}
	return browser.OpenURL("https://" + moduleIdentityString)
}
// run tidy to trim the buf.lock file for a specific module.
run tidy to trim the buf.lock file for a specific module.
// run tidy to trim the buf . lock file for a specific module .
func run(
	ctx context.Context,
	container appflag.Container,
) error {
	directoryInput, err := bufcli.GetInputValue(container, "", ".")
	if err != nil {
		return err
	}
	storageosProvider := storageos.NewProvider(storageos.ProviderWithSymlinks())
	readWriteBucket, err := storageosProvider.NewReadWriteBucket(
		directoryInput,
		storageos.ReadWriteBucketWithSymlinksIfSupported(),
	)
	if err != nil {
		return err
	}
	existingConfigFilePath, err := bufconfig.ExistingConfigFilePath(ctx, readWriteBucket)
	if err != nil {
		return err
	}
	if existingConfigFilePath == "" {
		return bufcli.ErrNoConfigFile
	}
	config, err := bufconfig.GetConfigForBucket(ctx, readWriteBucket)
	if err != nil {
		return err
	}
	var moduleIdentityString string
	if config.ModuleIdentity != nil {
		moduleIdentityString = config.ModuleIdentity.IdentityString()
	}
	if moduleIdentityString == "" {
		return fmt.Errorf("%s has no module name", existingConfigFilePath)
	}
	return browser.OpenURL("https://" + moduleIdentityString)
}
func run ( ctx context . Context , container appflag . Container , ) error { directoryInput , err := bufcli . GetInputValue ( container , " " , " " ) if err != nil { return err } storageosProvider := storageos . NewProvider ( storageos . ProviderWithSymlinks ( ) ) readWriteBucket , err := storageosProvider . NewReadWriteBucket ( directoryInput , storageos . ReadWriteBucketWithSymlinksIfSupported ( ) , ) if err != nil { return err } existingConfigFilePath , err := bufconfig . ExistingConfigFilePath ( ctx , readWriteBucket ) if err != nil { return err } if existingConfigFilePath == " " { return bufcli . ErrNoConfigFile } config , err := bufconfig . GetConfigForBucket ( ctx , readWriteBucket ) if err != nil { return err } var moduleIdentityString string if config . ModuleIdentity != nil { moduleIdentityString = config . ModuleIdentity . IdentityString ( ) } if moduleIdentityString == " " { return fmt . Errorf ( " " , existingConfigFilePath ) } return browser . OpenURL ( " " + moduleIdentityString ) }
run tidy to trim the buf.lock file for a specific module.
run tidy to trim the buf . lock file for a specific module .