Giter Site home page Giter Site logo

Improve package editing about proji HOT 6 CLOSED

nikoksr avatar nikoksr commented on May 27, 2024
Improve package editing

from proji.

Comments (6)

FelixMohr avatar FelixMohr commented on May 27, 2024 1

Sure :)

Screenshot 2020-12-08 at 19 08 06

Works exactly as intended:

  • No application has been chosen for opening TOML files: proji package edit opens the configuration with TextEdit (Screenshot). After saving and pressing Enter, the new config is persisted.
  • After specifying an application (VS Code) to be used for opening TOML files, proji package edit opens the file in VS Code. Updates are persisted successfully.

from proji.

nikoksr avatar nikoksr commented on May 27, 2024

See skratchdot/open-golang.

from proji.

nikoksr avatar nikoksr commented on May 27, 2024

A first version of this feature can be found here.

Need feedback if the automatic opening of config files works on different platforms:

  • Linux
  • MacOS
  • Windows

from proji.

FelixMohr avatar FelixMohr commented on May 27, 2024

Hi @nikoksr,

I've checked it on MacOS and unfortunately got an error.
Screenshot 2020-11-29 at 15 41 58

The reason is that on my machine, no application is connected to TOML files:
Screenshot 2020-11-29 at 15 41 10

I think this might apply to many users. A possible solution for MacOS might be to try open.Run first. If an error on MacOS occurs, instead, open.RunWith(configFile, "TextEdit") could be executed. TextEdit is a simple text editor that's available on any Mac.

Edit: Or just inform the user that no application is linked to TOML yet, instead of just showing the exit code.

from proji.

nikoksr avatar nikoksr commented on May 27, 2024

@FelixMohr I implemented your recommended changes. When the open command fails to automatically open the config in a text editor it will try to open the file with the program TextEdit.

Would be highly appreciated if you could test the changes on the improve-package-editing branch for macOS.

from proji.

nikoksr avatar nikoksr commented on May 27, 2024

Check package editing under Windows and it opened the dialog for choosing a default application for toml files immediately so I'll let that one pass working.

from proji.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.