Skip to content

Add shell chapters, update functions lesson, handle missing Welcome.md#868

Open
DergunNik wants to merge 4 commits intoronreiter:masterfrom
DergunNik:master
Open

Add shell chapters, update functions lesson, handle missing Welcome.md#868
DergunNik wants to merge 4 commits intoronreiter:masterfrom
DergunNik:master

Conversation

@DergunNik
Copy link

Regular Expressions and Special Commands sed,awk,grep,sort chapters were added for shell in English. The Shell Functions lesson was updated.

Welcome.md for Spanish shell was also added, since es already had the Hello World! lesson, but without an appropriate Welcome.md file the server would not boot. This issue existed before my changes, so the current version from GitHub could not be run.
The server failed with the following error (from docker):

... other warnings
app-1  | WARNING:root:File learnshell.org/en/Users_Management.md is not a tutorial
app-1  | Traceback (most recent call last):
app-1  |   File "/usr/src/app/main.py", line 351, in <module>
app-1  |     init_tutorials()
app-1  |     ~~~~~~~~~~~~~~^^
app-1  |   File "/usr/src/app/main.py", line 197, in init_tutorials
app-1  |     tutorials.remove("Welcome.md")
app-1  |     ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
app-1  | ValueError: list.remove(x): x not in list
app-1 exited with code 1

It may be worth adding an if check at line 196 in main.py to prevent similar cases in the future:

  if "Welcome.md" in tutorials:
      tutorials.remove("Welcome.md")
      tutorials = ["Welcome.md"] + tutorials
  else:
      logging.warning("Welcome.md not found in tutorials for %s/%s", domain, language)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant