Skip to content

IfExists("/foo/bar").Exec("/usr/bin/something") not working #141

@Meppo

Description

@Meppo
  • always do Exec() even thougth file not exists

env

go version go1.18.5 linux/amd64
  • go.mod
module example

go 1.18

require (
	github.com/bitfield/script v0.21.1
)

example code

package main

import "github.com/bitfield/script"

func main() {
	script.IfExists("not_exists_file").Exec("echo 'hello world'").Stdout()
}
  • output
$ ls
ex.go

$ go run ex.go 
hello world

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions