We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8c3613b commit 47b933cCopy full SHA for 47b933c
1 file changed
CoreShell/bin/cd.py
@@ -0,0 +1,20 @@
1
+import os
2
+from bin.cwd import cwd
3
+
4
+def cd(args=[]):
5
+ if len(args)>0:
6
+ try:
7
+ os.chdir(args[0])
8
+ output = f"cd: changed directory to '{cwd()}'"
9
+ except:
10
+ if os.path.isfile(args[0]):
11
+ output = f"cd: '{args[0]}' is a file."
12
+ else:
13
+ output = f"cd: no such file or directory '{args([0])}'"
14
15
+ output = "cd: no directory was provided."
16
+ return output
17
18
+def man(args=[]):
19
+ output = "Changes the directory.\nUsage: cd [path]"
20
0 commit comments