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

feat(cask): Add option to convert Cask to Eask #145

Merged
merged 4 commits into from
Mar 6, 2023

Conversation

jcs090218
Copy link
Member

@jcs090218 jcs090218 commented Mar 6, 2023

For #141. Add the options,

$ eask init --from cask [files..]

Another feature, the help instruction now look like this:

''                                                           ''

    Make sure you have a valid Cask-file in your directory

    Or specify Cask-file explicitly, like:

      $ eask init --from=cask /path/to/Cask

''                                                           ''

Expect for improvements.

@jcs090218 jcs090218 added the enhancement New feature or request label Mar 6, 2023
@jcs090218 jcs090218 merged commit 52bd410 into master Mar 6, 2023
@jcs090218 jcs090218 deleted the feature/cask-to-eask branch March 6, 2023 06:28
@Fuco1
Copy link
Contributor

Fuco1 commented Mar 6, 2023

I pulled the latest master and can't get this to work.

image

@jcs090218
Copy link
Member Author

Do you have Eask file in the directory? It will skip if there is already one presented. ;)

@Fuco1
Copy link
Contributor

Fuco1 commented Mar 6, 2023

No Eask file. I'm trying it in https://github.com/Fuco1/sphinx-mode repo now.

@jcs090218
Copy link
Member Author

It works on my side. 🤔

Running Eask in the development environment
Press Ctrl+C to cancel.

Executing script inside Emacs...

  Checking Emacs version 29.0.60... done!
  Checking system windows-nt... done!

Converting file `Cask` to `Eask`... done

(Total of 1 Cask-file converted)

The logic is here,

cli/lisp/init/cask.el

Lines 27 to 38 in 52bd410

(cond ((not (string-prefix-p "Cask" file))
(eask-debug "✗ Invalid Cask filename, the file should start with `Cask`"))
((file-exists-p new-filename)
(eask-debug "✗ The file `%s` already presented" new-file))
(t
(with-current-buffer (find-file new-filename)
(insert-file-contents file)
(goto-char (point-min))
(while (re-search-forward "(source " nil t)
(insert "'")) ; make it symbol
(save-buffer))
(setq converted t))))

It only checks for (file-exists-p ...) and (string-prefix-p "Cask" ...).

@Fuco1
Copy link
Contributor

Fuco1 commented Mar 6, 2023

Doesn't work for me not even on the master. I'll try to debug it from source.

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

Successfully merging this pull request may close these issues.

2 participants