dir fixing and stuff

This commit is contained in:
EverythingWindows 2022-11-06 21:19:35 +07:00
parent 1ca1bed37d
commit e17103c363
4 changed files with 25 additions and 0 deletions

View file

@ -1,6 +1,7 @@
Module DirectoryManagements Module DirectoryManagements
Dim spaces As String Dim spaces As String
Public Sub TerminalDirectories(TheDirectory As String) Public Sub TerminalDirectories(TheDirectory As String)
Terminal.Pseudodir = TheDirectory.Replace(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\ShiftFS", "!")
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Contents of " & Terminal.Pseudodir & Environment.NewLine Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Contents of " & Terminal.Pseudodir & Environment.NewLine
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "[DIR] 0 KB ." Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "[DIR] 0 KB ."
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "[DIR] 0 KB .." Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "[DIR] 0 KB .."

View file

@ -0,0 +1,10 @@
Imports System.IO
Module FileManagement
Public Sub CatFile(filename As String)
If File.Exists(Terminal.CurrentDirectory & "\" & filename) = True Then
Dim Contents As String = File.ReadAllText(Terminal.CurrentDirectory & "\" & filename)
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & Contents
End If
End Sub
End Module

View file

@ -180,6 +180,16 @@ Public Class Terminal
TerminalDirectories(CurrentDirectory) TerminalDirectories(CurrentDirectory)
AdvancedCommand = False AdvancedCommand = False
BadCommand = False BadCommand = False
Case "exit su"
If Strings.OnceInfo(0) = "No" Then
Else
AdvancedCommand = False
BadCommand = False
TextBox1.Text = TextBox1.Text & Environment.NewLine & "Exitting root mode..."
Strings.OnceInfo(0) = "No"
AssignPrompt()
End If
Case "guess" Case "guess"
ChangeInterpreter = True ChangeInterpreter = True
AppHost("guess", False) AppHost("guess", False)
@ -335,6 +345,9 @@ Public Class Terminal
End Select End Select
If AdvancedCommand = True Then If AdvancedCommand = True Then
If command Like "cat *" Then
CatFile(command.Substring(4))
End If
If command Like "cd *" Then If command Like "cd *" Then
NavigateDir(command.Replace("cd ", "")) NavigateDir(command.Replace("cd ", ""))
AdvancedCommand = False AdvancedCommand = False

View file

@ -100,6 +100,7 @@
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="MainForms\DirectoryManagements.vb" /> <Compile Include="MainForms\DirectoryManagements.vb" />
<Compile Include="MainForms\FileManagement.vb" />
<Compile Include="MainForms\IntroStory.Designer.vb"> <Compile Include="MainForms\IntroStory.Designer.vb">
<DependentUpon>IntroStory.vb</DependentUpon> <DependentUpon>IntroStory.vb</DependentUpon>
</Compile> </Compile>