Skip to content

Commit

Permalink
update to support macos
Browse files Browse the repository at this point in the history
  • Loading branch information
yorukot committed Apr 8, 2024
1 parent 12263d8 commit aa56390
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
5 changes: 3 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ All notable changes to this project will be documented in this file. Dates are d
#### Update

- Update `$HOME/.superfile` to `$XDG_CONFIG_HOME/superfile` [`886dbfb`](https://github.com/MHNightCat/superfile/commit/886dbfb276407db36e9fb7369ec31053e7aabcf4)
- Follow [The FreeDesktop.org Trash specification](https://specifications.freedesktop.org/trash-spec/trashspec-1.0.html) to update the trash bin path [`886dbfb`](https://github.com/MHNightCat/superfile/commit/886dbfb276407db36e9fb7369ec31053e7aabcf4)
- Follow [The FreeDesktop.org Trash specification](https://specifications.freedesktop.org/trash-spec/trashspec-1.0.html) to update the trash bin path in local path [`886dbfb`](https://github.com/MHNightCat/superfile/commit/886dbfb276407db36e9fb7369ec31053e7aabcf4)
- The external hard drive will be deleted directly ,But macOs for now not support trash can[`a4232a8`](https://github.com/MHNightCat/superfile/commit/a4232a88bef4b5c3e99456fd198eabb953dc324c)
- The user can enter the path, which will be the path of the first file panel [`14620b3`](https://github.com/MHNightCat/superfile/commit/14620b33b09edfce80a95e1f52f7f66b3686a9d0)
- Make user can open file with default browser text-editor etc [`f47d291`](https://github.com/MHNightCat/superfile/commit/f47d2915bf637da0cf99a4b15fa0bea8edc8d380)
- Can open terminal in focused file panel path [`f47d291`](https://github.com/MHNightCat/superfile/commit/f47d2915bf637da0cf99a4b15fa0bea8edc8d380)
- The external hard drive will be deleted directly (a confirmation message will be displayed) [``]()

#### Bug fix

- Fix processes bar cursor index display error [`f6eb9d8`](https://github.com/MHNightCat/superfile/commit/f6eb9d879f9f7ef31859e3f84c8792e2f0fc543a)
Expand Down
3 changes: 2 additions & 1 deletion src/components/normalModeController.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package components
import (
"os"
"path"
"runtime"
"time"

"os/exec"
Expand Down Expand Up @@ -124,7 +125,7 @@ func DeleteSingleItem(m model) model {
return m
}

if IsExternalPath(panel.location) {
if IsExternalPath(panel.location) || runtime.GOOS == "darwin"{
channel <- channelMessage{
processId: id,
returnWarnModal: true,
Expand Down
3 changes: 2 additions & 1 deletion src/components/selectModeController.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package components
import (
"os"
"path/filepath"
"runtime"

"github.com/atotto/clipboard"
"github.com/charmbracelet/bubbles/progress"
Expand Down Expand Up @@ -141,7 +142,7 @@ func DeleteMultipleItem(m model) model {
panel := m.fileModel.filePanels[m.filePanelFocusIndex]
if len(panel.selected) != 0 {
id := shortuuid.New()
if IsExternalPath(panel.location) {
if IsExternalPath(panel.location) || runtime.GOOS == "darwin" {
channel <- channelMessage{
processId: id,
returnWarnModal: true,
Expand Down
18 changes: 4 additions & 14 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@ import (
"archive/zip"
"encoding/json"
"fmt"
components "github.com/MHNightCat/superfile/components"
tea "github.com/charmbracelet/bubbletea"
"github.com/rkoesters/xdg/basedir"
"github.com/urfave/cli/v2"
"io"
"log"
"net/http"
"os"
"os/user"
"path/filepath"
"strings"
"time"

components "github.com/MHNightCat/superfile/components"
tea "github.com/charmbracelet/bubbletea"
"github.com/rkoesters/xdg/basedir"
"github.com/urfave/cli/v2"
)

var HomeDir = basedir.Home
Expand Down Expand Up @@ -75,14 +73,6 @@ func main() {
}
}

func getHomeDir() string {
user, err := user.Current()
if err != nil {
log.Fatal("can't get home dir")
}
return user.HomeDir
}

func InitConfigFile() {
var err error

Expand Down

0 comments on commit aa56390

Please sign in to comment.