diff --git a/pisi/actionsapi/shelltools.py b/pisi/actionsapi/shelltools.py index 826410c0..93385cca 100644 --- a/pisi/actionsapi/shelltools.py +++ b/pisi/actionsapi/shelltools.py @@ -37,6 +37,17 @@ def makedirs(destinationDirectory): except OSError: pass +def echo(destionationFile, content): + if can_access_file(destionationFile): + try: + f = open(destionationFile, 'a') + f.write("%s\n" % content) + f.close() + except IOError: + ctx.ui.error('\n!!! ActionsAPI [echo]: Can\'t append to file...\n') + else: + ctx.ui.error('\n!!! ActionsAPI [echo]: File doesn\'t exists...\n') + def chmod(sourceFile, mode = 0755): '''change the mode of sourceFile to the mode''' for file in glob.glob(sourceFile):