Return touched filenames instead of printing them.
This commit is contained in:
parent
453b2d2fb1
commit
5412af7d90
1 changed files with 2 additions and 2 deletions
|
@ -11,12 +11,12 @@ from voussoirkit import winglob
|
||||||
def touch(glob_pattern):
|
def touch(glob_pattern):
|
||||||
filenames = winglob.glob(glob_pattern)
|
filenames = winglob.glob(glob_pattern)
|
||||||
if len(filenames) == 0:
|
if len(filenames) == 0:
|
||||||
safeprint.safeprint(glob_pattern)
|
|
||||||
open(glob_pattern, 'a').close()
|
open(glob_pattern, 'a').close()
|
||||||
|
return [glob_pattern]
|
||||||
else:
|
else:
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
safeprint.safeprint(filename)
|
|
||||||
os.utime(filename)
|
os.utime(filename)
|
||||||
|
return filenames
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
glob_patterns = [clipext.resolve(x).strip() for x in sys.argv[1:]]
|
glob_patterns = [clipext.resolve(x).strip() for x in sys.argv[1:]]
|
||||||
|
|
Loading…
Reference in a new issue