Skip to content

Commit

Permalink
Merge pull request #53 from imthaghost/ugrade-ubunutu-ci
Browse files Browse the repository at this point in the history
Upgrade ubuntu to v20.04
  • Loading branch information
imthaghost committed Jun 2, 2023
2 parents 466fe2b + 84cad70 commit 83f7e27
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/feature-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
test:
name: Run Unit Test
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/master-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:
test:
name: Run Unit Test
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- name: Checkout
Expand Down
29 changes: 15 additions & 14 deletions cmd/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"net/http"
"net/http/cookiejar"
"net/url"
"runtime"
"strings"

"os/exec"
Expand Down Expand Up @@ -81,7 +82,7 @@ func cloneSite(ctx context.Context, args []string) error {
return server.Serve(firstProject)
} else if Open {
// automatically open project
cmd := open("open", firstProject+"/index.html")
cmd := open(firstProject + "/index.html")
if err := cmd.Start(); err != nil {
return fmt.Errorf("%v: %w", cmd.Args, err)
}
Expand All @@ -91,18 +92,18 @@ func cloneSite(ctx context.Context, args []string) error {

// open opens the specified URL in the default browser of the user.
func open(url string) *exec.Cmd {
var cmd string
var args []string
var cmd string
var args []string

switch runtime.GOOS {
case "windows":
cmd = "cmd"
args = []string{"/c", "start"}
case "darwin":
cmd = "open"
default: // "linux", "freebsd", "openbsd", "netbsd"
cmd = "xdg-open"
}
args = append(args, url)
return exec.Command(cmd, args...)
switch runtime.GOOS {
case "windows":
cmd = "cmd"
args = []string{"/c", "start"}
case "darwin":
cmd = "open"
default: // "linux", "freebsd", "openbsd", "netbsd"
cmd = "xdg-open"
}
args = append(args, url)
return exec.Command(cmd, args...)
}

0 comments on commit 83f7e27

Please sign in to comment.