From 56963a97101e0f52e9088406ef6a9e0c670204ce Mon Sep 17 00:00:00 2001 From: hanyixuanten Date: Mon, 14 Oct 2024 23:25:38 +0800 Subject: [PATCH] add update.php --- commands.md | 1 + commands/update.php | 23 +++++++++++++++++++++++ commands/when_adding_a_new_command | 4 +++- static/help/update.txt | 2 ++ static/terminal.php/help.txt | 1 + 5 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 commands/update.php create mode 100644 static/help/update.txt diff --git a/commands.md b/commands.md index 62d47a7..eec28a8 100644 --- a/commands.md +++ b/commands.md @@ -9,5 +9,6 @@ - pwd - shows the working directory - rm - deletes a file or directory - touch - creates a new file +- update - looks for updates **Try to do type help [command] in the terminal to show more details** diff --git a/commands/update.php b/commands/update.php new file mode 100644 index 0000000..47114b9 --- /dev/null +++ b/commands/update.php @@ -0,0 +1,23 @@ +", FILE_APPEND); + } else { + file_put_contents("recent.txt", "There is a new version $latest_v, you are using $now_v
", FILE_APPEND); + file_put_contents("recent.txt", "Download zip
", FILE_APPEND); + file_put_contents("recent.txt", "tar.gz
", FILE_APPEND); + } + } else { + file_put_contents("recent.txt", "Invalid number of arguments.
", FILE_APPEND); + } +} \ No newline at end of file diff --git a/commands/when_adding_a_new_command b/commands/when_adding_a_new_command index f6e86b2..9fac52a 100644 --- a/commands/when_adding_a_new_command +++ b/commands/when_adding_a_new_command @@ -1,3 +1,5 @@ write php write help.txt .txt -edit commands.md \ No newline at end of file +edit commands.md + +if new version: edit new_v in update.php \ No newline at end of file diff --git a/static/help/update.txt b/static/help/update.txt new file mode 100644 index 0000000..86834b0 --- /dev/null +++ b/static/help/update.txt @@ -0,0 +1,2 @@ +update - looks for updates
+usage: update
\ No newline at end of file diff --git a/static/terminal.php/help.txt b/static/terminal.php/help.txt index 69d1f95..298576d 100644 --- a/static/terminal.php/help.txt +++ b/static/terminal.php/help.txt @@ -7,4 +7,5 @@ mkdir - creates a new directory
pwd - shows the working directory
rm - deletes a file or directory
touch - creates a new file
+update - looks for updates
type help [command] to show more details
\ No newline at end of file