-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PICGO_ENV should not be coupled in picgo-core #103
Comments
inline-loader is a good solution for these scripts, I think you should just open a PR for inline-loader, I will take care of |
@Molunerfinn It seems the only usage of |
If we want to support picgo to different platforms, the |
For now, it may not be used in code, but would be used in the future |
Like your idea, this env will make plugins be aware of current picgo environment, it is super cool! But I think we should not save this
|
Yes, as I said, |
done |
Currently in picgo-core it will see if it is 'GUI' mode (in PicGo Electron) and look at different path for the clipboard scripts.
PicGo-Core/src/utils/getClipboardImage.ts
Lines 33 to 43 in f133d57
In my opinion, picgo core is just a library, it should not handle this kind of "hack" by itself. In the past, this special hack also affects vs-picgo: PicGo/vs-picgo#75
Also, vs-picgo has to do something like "copy the clipboard" files when bundling itself. See:
https://github.com/PicGo/vs-picgo/blob/f81a1dd7eaa5daf4be2b7329d92e9abf829892b7/esbuild.mjs#L96-L99
I think all these problems can be solved by just read these scripts into bundle by something like raw-loader. And write to a script when needed before running the script. In this way, all the scripts can be "bundled" into picgo-core with no trouble. And no one needs to handle the scripts files any more.
I have solved this in #102
The text was updated successfully, but these errors were encountered: