summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2019-10-19 11:08:56 -0400
committerGitHub <noreply@github.com>2019-10-19 11:08:56 -0400
commit2948d4ea68cd03712ffc4c8c436d4b8cf2f7ee81 (patch)
tree9e2cd384e57c0ba3c6e8f92ae556d5b3c153ee23 /cmd2/cmd2.py
parent600ebba66477304cba25d874c7a90ffffbe23676 (diff)
parent164e0b4b2dbf89c89c7e038123d9ae84075fabbc (diff)
downloadcmd2-git-2948d4ea68cd03712ffc4c8c436d4b8cf2f7ee81.tar.gz
Merge pull request #789 from python-cmd2/script_check
Script check
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r--cmd2/cmd2.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index 84945535..7d2cad20 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -498,10 +498,10 @@ class Cmd(cmd.Cmd):
# Commands that will run at the beginning of the command loop
self._startup_commands = []
- # If a startup script is provided, then execute it in the startup commands
+ # If a startup script is provided and exists, then execute it in the startup commands
if startup_script:
startup_script = os.path.abspath(os.path.expanduser(startup_script))
- if os.path.exists(startup_script) and os.path.getsize(startup_script) > 0:
+ if os.path.exists(startup_script):
self._startup_commands.append("run_script '{}'".format(startup_script))
# Transcript files to run instead of interactive command loop