mirror of
https://gitea.com/gitea/act_runner.git
synced 2025-10-27 02:50:41 +01:00
feat: Add support for service on Windows, Linux, and macOS
Introduce functionality to support the execution of the `act_runner` daemon as a service on various operating systems, including Windows, Linux, and macOS. This enhancement includes the ability to set the working directory using the `--working-directory` flag. Details: - The daemon can be installed and enabled with the command `act_runner daemon install`. - The service can be stopped and uninstalled using `act_runner daemon uninstall`. - The default working directory is set to the directory containing the `act_runner` executable. - During the installation process (`act_runner daemon install`), the service checks for the existence of `.runner` and `config.yaml` files in the same directory. If found, these files are loaded into the service. Note: Prior to running `act_runner daemon install`, ensure registration of `act_runner` with the command `act_runner register` to generate the required `.runner` file.
This commit is contained in:
19
internal/pkg/helpers/home_dir.go
Normal file
19
internal/pkg/helpers/home_dir.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package helpers
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/docker/docker/pkg/homedir"
|
||||
)
|
||||
|
||||
func GetCurrentWorkingDirectory() string {
|
||||
dir, err := os.Getwd()
|
||||
if err == nil {
|
||||
return dir
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func GetHomeDir() string {
|
||||
return homedir.Get()
|
||||
}
|
||||
Reference in New Issue
Block a user