summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
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