Skip to content
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

Add gulp script to auto install new theme on changes #37

Merged
merged 3 commits into from
Oct 4, 2019
Merged

Add gulp script to auto install new theme on changes #37

merged 3 commits into from
Oct 4, 2019

Conversation

krokofant
Copy link
Contributor

gulp dev provides a watch mode with auto install

Currently the auto install only works on Windows since I don't know where themes are installed on other platforms

Copy link
Owner

@noatpad noatpad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, didn't know about watch; Gulp.js is still pretty new to me, haha. This oughta help, though if you can add the MacOS case, that'd be great. Not sure how process.env works exactly, but I put the path to the themes folder in Mac in the comment below, so hopefully that helps figure that out.
I'll update the README that the built files will be in dist/ instead right afterwards


const dev = () => {
let themeLocation;
switch (os.type()) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can tell, themes in MacOS are stored in ~/Library/Application Support/abnerworks.Typora/themes, where ~ is the user's home folder. Not sure how process.env works here, but the case for Mac would be along the lines of this:

case "Darwin":
	themeLocation = "~/Library/Application Support/abnerworks.Typora/themes"
	break;

Not sure about Linux though

@krokofant
Copy link
Contributor Author

@aCluelessDanny Since these are dev tools it's okay if it works on the device that the devs use. If it doesn't work on Linux that's a issue for a later time. Please merge and we can improve it from there.

@noatpad noatpad merged commit a591f15 into noatpad:dev Oct 4, 2019
@krokofant krokofant deleted the feat/dev-script branch October 14, 2019 07:52
@AdryDev92
Copy link

gulp dev provides a watch mode with auto install

Currently the auto install only works on Windows since I don't know where themes are installed on other platforms

Theme folder location in linux: ~/.config/Typora/themes

@noatpad
Copy link
Owner

noatpad commented Nov 20, 2019

Noted. I'll put that in the next release~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants