GithubHelp home page GithubHelp logo

Include path about ahkpm HOT 2 OPEN

anonymous1184 avatar anonymous1184 commented on June 12, 2024 2
Include path

from ahkpm.

Comments (2)

SaifAqqad avatar SaifAqqad commented on June 12, 2024 1

The second option where an ahkpm-modules.ahk contains the rest of the includes is actually a really good idea, but this would mean that ahkpm install will need to add an include in the ahkpm-modules.ahk file and ahkpm needs to keep track of it.

Also I think we would need an ahkpm uninstall command to remove the package

BTW in the ahkpm-modules.ahk file, A_LineFIle could be used to reference it's own path

#Include %A_LineFile%\..\github.com\joshuacc\simple-http\simple-http.ahk

from ahkpm.

joshuacc avatar joshuacc commented on June 12, 2024

The project looks really good.

Thanks!

What if I decide to use the same package/version from my own Gitea or Codeberg or whatever else? This will do regardless of the upstream:

; Option 1:
#Include, %A_ScriptDir%\ahkpm-modules\simple-http.ahk
; Optionally:
#Include, %A_ScriptDir%\ahkpm-modules\simple-http

It is easier to manage (and it doesn't even need the extension).

Unfortunately, I don't believe that will work, because fundamentally your copy of a package is a different package, where you are free to version and update entirely separately from the original. You could even rewrite the entire git history if you wanted to.

Because of this issue, ahkpm can't allow referring to different git repositories by the same name. Not only because it can potentially cause confusion. It could easily lead to security issues as well.

; Option 2:
#Include, %A_ScriptDir%\ahkpm-modules.ahk
; Optionally:
; #Include, %A_ScriptDir%\ahkpm-modules

This is even better as that file can contain all the packages with full paths.

The end user is presented with just a single line and that's a relief for many AHK users as the target audience is people that doesn't code.

This option may be viable. When working purely with packages that have an ahkpm.json file and a valid include path, this would probably work the vast majority of the time. Just automatically update the ahkpm-modules.ahk file with the includes whenver we run ahkpm install.

There are two scenarios where it gets more complicated.

  1. Packages that don't have a single main file to #Include, but allow
    including several different files.
  2. "Packages" that are just git repositories without an ahkpm.json.

The first one may or may not be a big deal, but I do think that it would be confusing to users that including ahkpm-modules.ahk usually includes all of their libraries, but not always.

The second one seems more problematic. Now, and for a while to come, most of the AHK packages that ahkpm can install will be plain git repositories without any ahkpm.json file at all. If they happen to only have a single *.ahk file in the repo, then we could automatically infer the proper include path. But what if it is more complicated? (As many of the existing GitHub repos are.)

At the very least, we would need to find a way to signal to the user that they need to handle those #Include's manually. And I don't have great ideas about how to do that yet.

Given that your project is written in Go, you can add compatibility regardless of what the users have installed. And is just the removal of the comma:

Yep! This is something I will definitely fix in the next couple of days. I've opened #180 to track it until then.

I was quite surprised when AutoHotkey 2 went into RC. :)

from ahkpm.

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.