mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-14 20:03:42 +00:00
enhance: add builtin:download-artifact (#1344)
Co-authored-by: bircni <[email protected]>
This commit is contained in:
1 parent
02446620df
commit
c8b16f4792
11 files changed
+912
-4
No files matched your search
@@ -103,6 +103,13 @@ func (c *Context) Windows() bool {
|
||||
return c.Host() && runtime.GOOS == "windows"
|
||||
}
|
||||
|
||||
func (c *Context) Join(elem ...string) string {
|
||||
if c.Windows() {
|
||||
return filepath.Join(elem...)
|
||||
}
|
||||
return path.Join(elem...)
|
||||
}
|
||||
|
||||
func (c *Context) Dir(p string) string {
|
||||
if c.Windows() {
|
||||
return filepath.Dir(p)
|
||||
@@ -117,6 +124,13 @@ func (c *Context) Base(p string) string {
|
||||
return path.Base(p)
|
||||
}
|
||||
|
||||
func (c *Context) Resolve(p string) string {
|
||||
if c.Windows() && filepath.IsAbs(p) || !c.Windows() && path.IsAbs(p) {
|
||||
return c.Join(p)
|
||||
}
|
||||
return c.Join(c.Workspace, p)
|
||||
}
|
||||
|
||||
// Home is the job user's home directory, what os.homedir() returns to a JavaScript action.
|
||||
func (c *Context) Home(ctx context.Context) (string, error) {
|
||||
if home := c.Env["HOME"]; home != "" {
|
||||
|
||||
Reference in new issue
Block a user