clean up
This commit is contained in:
parent
81a1add837
commit
5a4be6dad6
5 changed files with 133 additions and 177 deletions
28
run.bat
28
run.bat
|
@ -1,31 +1,17 @@
|
|||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
rem Directory where the Go files are located
|
||||
set GO_DIR=C:\path\to\your\go\files
|
||||
|
||||
rem Explicitly list the main files in the required order
|
||||
set FILES=main.go init.go text.go text-google.go text-librex.go text-brave.go text-duckduckgo.go common.go cache.go agent.go files.go files-thepiratebay.go files-torrentgalaxy.go forums.go get-searchxng.go imageproxy.go images.go images-imgur.go images-quant.go map.go node.go open-search.go video.go
|
||||
|
||||
rem Change to the directory with the Go files
|
||||
pushd %GO_DIR%
|
||||
|
||||
rem Find all other .go files that were not explicitly listed
|
||||
set OTHER_GO_FILES=
|
||||
rem Use the current directory where the script is executed
|
||||
pushd %~dp0
|
||||
|
||||
rem Collect all .go files in the current directory
|
||||
set GO_FILES=
|
||||
for %%f in (*.go) do (
|
||||
set file=%%~nxf
|
||||
set found=0
|
||||
for %%i in (%FILES%) do (
|
||||
if /i "%%i"=="!file!" set found=1
|
||||
)
|
||||
if !found!==0 (
|
||||
set OTHER_GO_FILES=!OTHER_GO_FILES! "%%f"
|
||||
)
|
||||
set GO_FILES=!GO_FILES! %%f
|
||||
)
|
||||
|
||||
rem Run the Go program with the specified files first, followed by the remaining files
|
||||
go run %FILES% %OTHER_GO_FILES%
|
||||
rem Run the Go program with all the .go files
|
||||
go run !GO_FILES!
|
||||
|
||||
rem Return to the original directory
|
||||
popd
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue