Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7162b39 authored by Alexander Smundak's avatar Alexander Smundak Committed by Gerrit Code Review
Browse files

Merge "Fix rblf_file_exists, it should return true for a directory, too."

parents 4cc80241 3c569799
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ func fileExists(_ *starlark.Thread, b *starlark.Builtin, args starlark.Tuple,
	if err := starlark.UnpackPositionalArgs(b.Name(), args, kwargs, 1, &path); err != nil {
		return starlark.None, err
	}
	if stat, err := os.Stat(path); err != nil || stat.IsDir() {
	if _, err := os.Stat(path); err != nil {
		return starlark.False, nil
	}
	return starlark.True, nil
+1 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ load("assert.star", "assert")

def test():
    myname = "file_ops.star"
    assert.true(rblf_file_exists("."), "./ exists ")
    assert.true(rblf_file_exists(myname), "the file %s does exist" % myname)
    assert.true(not rblf_file_exists("no_such_file"), "the file no_such_file does not exist")
    files = rblf_wildcard("*.star")