File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -112,24 +112,24 @@ snake build:tools [typ=core] # Builds the application
112112
113113## API Reference
114114
115- ### ` @task(requires=None) `
115+ #### ` @task(requires=None) `
116116
117117Decorates a function that then exposes it as a task to be run.
118118The name of the function becomes the name of the task.
119119The ` requires ` parameter, if specified, is a list of strings where each string is the name of a task that this one depends on.
120120
121- ### ` @namespace `
121+ #### ` @namespace `
122122
123123Decorates a function so that it exposes a task namespace.
124124The name of the function becomes the name of the namespace.
125125Tasks and nested namespaces can be defined in the namespace and will be called as ` namespace:task ` .
126126
127- ### ` sh(command, silent=False) `
127+ #### ` sh(command, silent=False) `
128128
129129Runs a shell command.
130130If silent is not specified, an exception will be raised if the resulting status of the command is nonzero.
131131
132- ### ` ENV `
132+ #### ` ENV `
133133
134134A dict that gives you access to environment variables.
135135It has a special property that accessing by key using brackets will not raise a ` KeyError ` but will return ` None ` instead.
Original file line number Diff line number Diff line change @@ -16,6 +16,14 @@ def __init__(self, logger):
1616 self .logger = logger
1717
1818 def execute (self , command , silent = False ):
19+ """Executes a command using the user's shell. A nonzero exit status will raise an exception unless
20+ silent is specified.
21+
22+ :param command: the command to run as a string
23+ :param silent: if false, will raise if the command fails
24+
25+ :return: the exit status of the command
26+ """
1927 self .logger .info (command )
2028 exit_status = call (command , shell = True )
2129 if exit_status != 0 and not silent :
You can’t perform that action at this time.
0 commit comments