Skip to content

Commit

Permalink
feat: add a half-baked init command
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewpeck committed Apr 23, 2024
1 parent ae5d162 commit 14b5fa2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions hog.el
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,21 @@ The resulting list is of the form:
(concat (hog--project-root) filename)
(buffer-substring-no-properties (line-beginning-position) (line-end-position))))))

(defun hog-init-project ()
"Init a Hog project in the current directory."
(interactive)
(shell-command "git submodule add https://gitlab.com/hog-cern/Hog.git")
(when (not (file-exists-p ".gitignore"))
(shell-command "cp Hog/Templates/gitignore .gitignore"))

(when (not (file-exists-p ".gitlab-ci.yml"))
(shell-command "cp Hog/Templates/gitlab-ci.yml .gitlab-ci.yml"))

(when (not (file-exists-p "Top/project/hog.conf"))
(mkdir "Top/project" t)
(mkdir "Top/project/list" t)
(shell-command "cp Hog/Templates/hog_vivado.conf Top/project/hog.conf")))

;; FIXME: does not work with file names with spaces
;; spaces should be escaped
(defun hog-follow-link-at-point ()
Expand Down

0 comments on commit 14b5fa2

Please sign in to comment.