You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<code>setUser</code>, Josh functions do not have a separate error handler. Since Josh interacts with the UI, it has no concept of failure -- it has to execute the callback to continue executing. It is up to the caller to deal with errors and transform them into the appropriate UI response. But it still gives us the flexibility to undertake an asynchronous actions, such as calling a remote API and complete the function execution upon the asynchronous return of the remote call.
<p>The <ahref="docs/githubconsole.html#cmd.user" target="_blank"><code>user</code></a> command does not have
198
+
<p>The <ahref="docs/githubconsole.html#cmd.user" target="docs"><code>user</code></a> command does not have
199
199
<code>TAB</code> completion, since doing efficient tab completion against the full set of GitHub users is beyond this tutorial. Instead it expects a valid username to call
200
-
<ahref="docs/githubconsole.html#setUser" target="_blank"><code>setUser(user_name, repo_name, err, callback)</code></a> with and on completion renders the user template with the new current user.
200
+
<ahref="docs/githubconsole.html#setUser" target="docs"><code>setUser(user_name, repo_name, err, callback)</code></a> with and on completion renders the user template with the new current user.
201
201
</p>
202
202
203
203
<p>If called without a <em>username</em>, we simply render user template with the current user.</p>
<ahref="docs/githubconsole.html#cmd.repo" target="_blank"><code>repo</code></a> command can either show information about the current repository, change the current repository or list all repositories belonging to the user. It also provides
208
+
<ahref="docs/githubconsole.html#cmd.repo" target="docs"><code>repo</code></a> command can either show information about the current repository, change the current repository or list all repositories belonging to the user. It also provides
209
209
<code>TAB</code> completion of partial repository names against the repositories of the current user.</p>
210
210
211
211
<p>Given no argument, we simply render the repository template with the current repository</p>
@@ -214,7 +214,7 @@ <h3><a href="docs/githubconsole.html#cmd.repo" target="_blank">repo [<em>-l | re
214
214
<em>-l</em>, we render the repository list template with the repositories we fetched on user initialization.</p>
215
215
216
216
<p>Finally, the argument is used to try and retrieve the repository from the known repositories. If that succeeds, we call
217
-
<ahref="docs/githubconsole.html#setRepo" target="_blank"><code>setRepo(repo, err, callback)</code></a>, which fetches the root directory to initialize the current node of
217
+
<ahref="docs/githubconsole.html#setRepo" target="docs"><code>setRepo(repo, err, callback)</code></a>, which fetches the root directory to initialize the current node of
218
218
<code>Josh.PathHandler</code> before changing the current repository to the one specified. Upon switching we again render the repository template with the now current repository.
219
219
</p>
220
220
@@ -223,18 +223,18 @@ <h3><a href="docs/githubconsole.html#cmd.repo" target="_blank">repo [<em>-l | re
223
223
<code>bestMatch</code> takes care of creating the completion object with the appropriate argument completion and list of possible choices.
<p>T can either show information about the current repository, change the current repository or list all repositories belonging to the user. It also provides
229
229
<code>TAB</code> completion of partial repository names against the repositories of the current user.</p>
230
230
231
231
<p>Given no argument, the
232
-
<ahref="docs/githubconsole.html#cmd.branch" target="_blank"><code>branch</code></a> command simply prints the current branch name. The
232
+
<ahref="docs/githubconsole.html#cmd.branch" target="docs"><code>branch</code></a> command simply prints the current branch name. The
233
233
<em>-l</em> argument renders a list of all known branches for the current repository, while an actualy branchname as argument will cause the console to change its current branch.
234
234
</p>
235
235
236
236
<p>Showing the list of branches uses
237
-
<ahref="docs/githubconsole.html#ensureBranches" target="_blank"><code>ensureBranches(err, callback)</code></a> to lazily initialize the list of branches from the API.
237
+
<ahref="docs/githubconsole.html#ensureBranches" target="docs"><code>ensureBranches(err, callback)</code></a> to lazily initialize the list of branches from the API.
238
238
</p>
239
239
240
240
<p>The completion handler for the command simply calls
<p><code>PathHandler</code> provides unix filepath handling. This works by abstracting the filesystem into two operations, <ahref="docs/githubconsole.html#getNode" target="_blank"><code>getNode(path, callback)</code></a> and <ahref="docs/githubconsole.html#getChildNodes" target="_blank"><code>getChildNodes(node, callback)</code></a>. The former returns a file node given a path string while the latter returns file nodes for all children of a given node. With these two all tree operations including <code>TAB</code> completion can be accomplished by <code>PathHandler</code>.</p>
246
+
<p><code>PathHandler</code> provides unix filepath handling. This works by abstracting the filesystem into two operations, <ahref="docs/githubconsole.html#getNode" target="docs"><code>getNode(path, callback)</code></a> and <ahref="docs/githubconsole.html#getChildNodes" target="docs"><code>getChildNodes(node, callback)</code></a>. The former returns a file node given a path string while the latter returns file nodes for all children of a given node. With these two all tree operations including <code>TAB</code> completion can be accomplished by <code>PathHandler</code>.</p>
247
247
<p>A file node is an opaque object in which we can track any file state we want but has to have two properties:</p>
0 commit comments