From 910f1990d269e6b2596672d137a638aab19a1a66 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Fri, 13 Oct 2023 07:33:21 -0700 Subject: [PATCH 1/3] fix: Move global Eask-file config to home --- lisp/core/status.el | 2 +- src/util.js | 2 +- test/fixtures/{mini.eask => home}/Eask | 0 .../{mini.eask => home}/scripts/copy_eask.ps1 | 0 .../{mini.eask => home}/scripts/copy_eask.sh | 0 test/fixtures/mini.eask/.gitignore | 99 ------------------- test/fixtures/mini.eask/init.el | 27 ----- 7 files changed, 2 insertions(+), 128 deletions(-) rename test/fixtures/{mini.eask => home}/Eask (100%) rename test/fixtures/{mini.eask => home}/scripts/copy_eask.ps1 (100%) rename test/fixtures/{mini.eask => home}/scripts/copy_eask.sh (100%) delete mode 100644 test/fixtures/mini.eask/.gitignore delete mode 100644 test/fixtures/mini.eask/init.el diff --git a/lisp/core/status.el b/lisp/core/status.el index f5899bd4..28365f32 100644 --- a/lisp/core/status.el +++ b/lisp/core/status.el @@ -25,7 +25,7 @@ (defun eask--environment-name () "Get the working environment name." - (cond ((eask-global-p) "global (~/.eask/)") + (cond ((eask-global-p) "global (~/)") ((eask-config-p) (format "configuration (%s)" user-emacs-directory)) (t "development (./)"))) diff --git a/src/util.js b/src/util.js index 414278aa..654537d9 100644 --- a/src/util.js +++ b/src/util.js @@ -185,7 +185,7 @@ function el_script(name) { */ function _environment_name (argv) { if (argv.global) - return 'global (~/.eask/)'; + return 'global (~/)'; else if (argv.config) return 'configuration (~/.emacs.d/)'; else diff --git a/test/fixtures/mini.eask/Eask b/test/fixtures/home/Eask similarity index 100% rename from test/fixtures/mini.eask/Eask rename to test/fixtures/home/Eask diff --git a/test/fixtures/mini.eask/scripts/copy_eask.ps1 b/test/fixtures/home/scripts/copy_eask.ps1 similarity index 100% rename from test/fixtures/mini.eask/scripts/copy_eask.ps1 rename to test/fixtures/home/scripts/copy_eask.ps1 diff --git a/test/fixtures/mini.eask/scripts/copy_eask.sh b/test/fixtures/home/scripts/copy_eask.sh similarity index 100% rename from test/fixtures/mini.eask/scripts/copy_eask.sh rename to test/fixtures/home/scripts/copy_eask.sh diff --git a/test/fixtures/mini.eask/.gitignore b/test/fixtures/mini.eask/.gitignore deleted file mode 100644 index c0cc738b..00000000 --- a/test/fixtures/mini.eask/.gitignore +++ /dev/null @@ -1,99 +0,0 @@ -# settings -/site-lisp/custom.el -README.html - -*.bak -*.data -*.db -*.elc -*.log -*.sqlite -*.tmp -*bak/ -.DS_Store -.cache/ -.cask/ -.dap-* -.extension/ -.vscode/ -/.agignore -/.elfeed -/.emacs*.desktop -/.emacs*.desktop.lock -/.emacs-buffers -/.last-package-update-day -/.lsp-session* -/.markdown-preview.html -/.mc-lists.el -/.org-id-locations -/.pdf-view-restore -/.persistent-scratch -/.rgignore -/ac-comphist.dat -/amx-items -/bookmarks -/company-statistics-cache.el -/custom-post.el -/history -/nov-places -/package-quickstart.el -/places -/projectile-bookmarks.eld -/projectile.cache -/projects -/recentf -/scratch -/smex-items -/tramp -anaconda-mode/ -auto-save-list/ -cnfonts/ -devdocs-browser/ -devdocs/ -eclipse.jdt.ls/ -eln-cache/ -elpa-devel/ -elpa/ -emojis/ -eshell/ -flycheck_*.el* -games/ -ido.* -image-dired/ -images/ -irony/ -librime/ -magithub/ -mspyls/ -newsticker/ -persistent-scratch/ -persp-confs/ -rcirc-log/ -request/ -rime/ -rust-playground/ -server/ -session* -snippets/ -thumbs/ -tldr/ -tmp* -transient/ -tutorial/ -url/ -var/ -workspace/ - -# tags -/GPATH -/GRTAGS -/GTAGS -/TAGS - -# eask packages -.eask/ -dist/ - -# packaging -*-autoloads.el -*-pkg.el diff --git a/test/fixtures/mini.eask/init.el b/test/fixtures/mini.eask/init.el deleted file mode 100644 index 08777729..00000000 --- a/test/fixtures/mini.eask/init.el +++ /dev/null @@ -1,27 +0,0 @@ -;;; init.el --- Load the full configuration -*- lexical-binding: t -*- -;;; Commentary: - -;; Author: Shen, Jen-Chieh -;; URL: https://github.com/emacs-eask/cli - -(setq package-archives - '(("gnu" . "http://elpa.gnu.org/packages/") - ("nongnu" . "http://elpa.nongnu.org/nongnu/") - ("melpa" . "http://melpa.org/packages/") - ("jcs-elpa" . "https://jcs-emacs.github.io/jcs-elpa/packages/")) - package-archive-priorities - '(("gnu" . 0) - ("nongnu" . 0) - ("melpa" . 5) - ("jcs-elpa" . 10))) - -(setq package-enable-at-startup nil ; To avoid initializing twice - package-check-signature nil) - -(require 'package) - -;; Local Variables: -;; coding: utf-8 -;; no-byte-compile: t -;; End: -;;; init.el ends here From f0ef58d300610527fb0db96be9d83fd5a5c3dac7 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Fri, 13 Oct 2023 07:43:03 -0700 Subject: [PATCH 2/3] fix --- test/commands/config/run.sh | 2 +- test/commands/global/run.sh | 4 +- .../{mini.emacs.d => home/.eask}/.gitignore | 0 .../{mini.emacs.d => home/.eask}/init.el | 0 test/fixtures/home/.emacs.d/.gitignore | 99 +++++++++++++++++++ .../{mini.emacs.d => home/.emacs.d}/Eask | 0 .../{mini.emacs.d => home/.emacs.d}/RADME.md | 0 test/fixtures/home/.emacs.d/init.el | 27 +++++ test/fixtures/home/.gitignore | 1 + .../home/scripts/{copy_eask.ps1 => setup.ps1} | 7 +- .../home/scripts/{copy_eask.sh => setup.sh} | 6 +- .../mini.emacs.d/scripts/copy_config.ps1 | 25 ----- .../mini.emacs.d/scripts/copy_config.sh | 26 ----- 13 files changed, 141 insertions(+), 56 deletions(-) rename test/fixtures/{mini.emacs.d => home/.eask}/.gitignore (100%) rename test/fixtures/{mini.emacs.d => home/.eask}/init.el (100%) create mode 100644 test/fixtures/home/.emacs.d/.gitignore rename test/fixtures/{mini.emacs.d => home/.emacs.d}/Eask (100%) rename test/fixtures/{mini.emacs.d => home/.emacs.d}/RADME.md (100%) create mode 100644 test/fixtures/home/.emacs.d/init.el create mode 100644 test/fixtures/home/.gitignore rename test/fixtures/home/scripts/{copy_eask.ps1 => setup.ps1} (72%) rename test/fixtures/home/scripts/{copy_eask.sh => setup.sh} (84%) delete mode 100644 test/fixtures/mini.emacs.d/scripts/copy_config.ps1 delete mode 100644 test/fixtures/mini.emacs.d/scripts/copy_config.sh diff --git a/test/commands/config/run.sh b/test/commands/config/run.sh index 57bbfb33..bd599f1b 100644 --- a/test/commands/config/run.sh +++ b/test/commands/config/run.sh @@ -28,7 +28,7 @@ set -e echo "Copy test configuration" -./test/fixtures/mini.emacs.d/scripts/copy_config.sh +./test/fixtures/home/scripts/setup.sh echo "Testing config (~/.emacs.d/) commands..." eask archives -c diff --git a/test/commands/global/run.sh b/test/commands/global/run.sh index 3f130679..c801dd72 100644 --- a/test/commands/global/run.sh +++ b/test/commands/global/run.sh @@ -28,9 +28,9 @@ set -e echo "Copy test configuration" -./test/fixtures/mini.eask/scripts/copy_eask.sh +./test/fixtures/home/scripts/setup.sh -echo "Testing global (~/.eask/) commands..." +echo "Testing global (~/) commands..." eask archives -g eask install -g spinner ivy beacon company fuzzy diff --git a/test/fixtures/mini.emacs.d/.gitignore b/test/fixtures/home/.eask/.gitignore similarity index 100% rename from test/fixtures/mini.emacs.d/.gitignore rename to test/fixtures/home/.eask/.gitignore diff --git a/test/fixtures/mini.emacs.d/init.el b/test/fixtures/home/.eask/init.el similarity index 100% rename from test/fixtures/mini.emacs.d/init.el rename to test/fixtures/home/.eask/init.el diff --git a/test/fixtures/home/.emacs.d/.gitignore b/test/fixtures/home/.emacs.d/.gitignore new file mode 100644 index 00000000..c0cc738b --- /dev/null +++ b/test/fixtures/home/.emacs.d/.gitignore @@ -0,0 +1,99 @@ +# settings +/site-lisp/custom.el +README.html + +*.bak +*.data +*.db +*.elc +*.log +*.sqlite +*.tmp +*bak/ +.DS_Store +.cache/ +.cask/ +.dap-* +.extension/ +.vscode/ +/.agignore +/.elfeed +/.emacs*.desktop +/.emacs*.desktop.lock +/.emacs-buffers +/.last-package-update-day +/.lsp-session* +/.markdown-preview.html +/.mc-lists.el +/.org-id-locations +/.pdf-view-restore +/.persistent-scratch +/.rgignore +/ac-comphist.dat +/amx-items +/bookmarks +/company-statistics-cache.el +/custom-post.el +/history +/nov-places +/package-quickstart.el +/places +/projectile-bookmarks.eld +/projectile.cache +/projects +/recentf +/scratch +/smex-items +/tramp +anaconda-mode/ +auto-save-list/ +cnfonts/ +devdocs-browser/ +devdocs/ +eclipse.jdt.ls/ +eln-cache/ +elpa-devel/ +elpa/ +emojis/ +eshell/ +flycheck_*.el* +games/ +ido.* +image-dired/ +images/ +irony/ +librime/ +magithub/ +mspyls/ +newsticker/ +persistent-scratch/ +persp-confs/ +rcirc-log/ +request/ +rime/ +rust-playground/ +server/ +session* +snippets/ +thumbs/ +tldr/ +tmp* +transient/ +tutorial/ +url/ +var/ +workspace/ + +# tags +/GPATH +/GRTAGS +/GTAGS +/TAGS + +# eask packages +.eask/ +dist/ + +# packaging +*-autoloads.el +*-pkg.el diff --git a/test/fixtures/mini.emacs.d/Eask b/test/fixtures/home/.emacs.d/Eask similarity index 100% rename from test/fixtures/mini.emacs.d/Eask rename to test/fixtures/home/.emacs.d/Eask diff --git a/test/fixtures/mini.emacs.d/RADME.md b/test/fixtures/home/.emacs.d/RADME.md similarity index 100% rename from test/fixtures/mini.emacs.d/RADME.md rename to test/fixtures/home/.emacs.d/RADME.md diff --git a/test/fixtures/home/.emacs.d/init.el b/test/fixtures/home/.emacs.d/init.el new file mode 100644 index 00000000..08777729 --- /dev/null +++ b/test/fixtures/home/.emacs.d/init.el @@ -0,0 +1,27 @@ +;;; init.el --- Load the full configuration -*- lexical-binding: t -*- +;;; Commentary: + +;; Author: Shen, Jen-Chieh +;; URL: https://github.com/emacs-eask/cli + +(setq package-archives + '(("gnu" . "http://elpa.gnu.org/packages/") + ("nongnu" . "http://elpa.nongnu.org/nongnu/") + ("melpa" . "http://melpa.org/packages/") + ("jcs-elpa" . "https://jcs-emacs.github.io/jcs-elpa/packages/")) + package-archive-priorities + '(("gnu" . 0) + ("nongnu" . 0) + ("melpa" . 5) + ("jcs-elpa" . 10))) + +(setq package-enable-at-startup nil ; To avoid initializing twice + package-check-signature nil) + +(require 'package) + +;; Local Variables: +;; coding: utf-8 +;; no-byte-compile: t +;; End: +;;; init.el ends here diff --git a/test/fixtures/home/.gitignore b/test/fixtures/home/.gitignore new file mode 100644 index 00000000..faa60f92 --- /dev/null +++ b/test/fixtures/home/.gitignore @@ -0,0 +1 @@ +!.eask diff --git a/test/fixtures/home/scripts/copy_eask.ps1 b/test/fixtures/home/scripts/setup.ps1 similarity index 72% rename from test/fixtures/home/scripts/copy_eask.ps1 rename to test/fixtures/home/scripts/setup.ps1 index 6928a560..9a0acf7e 100644 --- a/test/fixtures/home/scripts/copy_eask.ps1 +++ b/test/fixtures/home/scripts/setup.ps1 @@ -22,4 +22,9 @@ echo "Copy test configuration" mkdir "$env:USERPROFILE/AppData/Roaming/.eask" -robocopy /e "./test/fixtures/mini.eask/" "$env:USERPROFILE/AppData/Roaming/.eask" +robocopy /e "./test/fixtures/home/_eask/" "$env:USERPROFILE/AppData/Roaming/.eask" +robocopy /e "./test/fixtures/home/Eask" "$env:USERPROFILE/AppData/Roaming/Eask" + +echo "Copy test configuration" +mkdir "$env:USERPROFILE/AppData/Roaming/.emacs.d" +robocopy /e "./test/fixtures/home/.emacs.d/" "$env:USERPROFILE/AppData/Roaming/.emacs.d" diff --git a/test/fixtures/home/scripts/copy_eask.sh b/test/fixtures/home/scripts/setup.sh similarity index 84% rename from test/fixtures/home/scripts/copy_eask.sh rename to test/fixtures/home/scripts/setup.sh index d6e05ee9..d2c45538 100644 --- a/test/fixtures/home/scripts/copy_eask.sh +++ b/test/fixtures/home/scripts/setup.sh @@ -23,4 +23,8 @@ # echo "Copy test .eask" -cp -R ./test/fixtures/mini.eask/ ~/.eask +cp -R ./test/fixtures/home/_eask/ ~/.eask +cp -R ./test/fixtures/home/Eask ~/Eask + +echo "Copy test configuration" +cp -R ./test/fixtures/home/.emacs.d/ ~/.emacs.d diff --git a/test/fixtures/mini.emacs.d/scripts/copy_config.ps1 b/test/fixtures/mini.emacs.d/scripts/copy_config.ps1 deleted file mode 100644 index 3dfe49e7..00000000 --- a/test/fixtures/mini.emacs.d/scripts/copy_config.ps1 +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2022-2023 Jen-Chieh Shen - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with GNU Emacs; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. - -## Commentary: -# -# Copy configuration over to ~/.emacs.d/ -# - -echo "Copy test configuration" -mkdir "$env:USERPROFILE/AppData/Roaming/.emacs.d" -robocopy /e "./test/fixtures/mini.emacs.d/" "$env:USERPROFILE/AppData/Roaming/.emacs.d" diff --git a/test/fixtures/mini.emacs.d/scripts/copy_config.sh b/test/fixtures/mini.emacs.d/scripts/copy_config.sh deleted file mode 100644 index 7519153d..00000000 --- a/test/fixtures/mini.emacs.d/scripts/copy_config.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) 2022-2023 Jen-Chieh Shen - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with GNU Emacs; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. - -## Commentary: -# -# Copy configuration over to ~/.emacs.d/ -# - -echo "Copy test configuration" -cp -R ./test/fixtures/mini.emacs.d/ ~/.emacs.d From 0ebb854b38c257c01066393a590a5e80acc26139 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Fri, 13 Oct 2023 08:02:59 -0700 Subject: [PATCH 3/3] rev --- lisp/_prepare.el | 2 +- test/fixtures/home/Eask | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/_prepare.el b/lisp/_prepare.el index a57f8477..6db4c69b 100644 --- a/lisp/_prepare.el +++ b/lisp/_prepare.el @@ -1028,7 +1028,7 @@ This uses function `locate-dominating-file' to look up directory tree." ;; for the sandbox. (eask-with-verbosity 'debug (eask-ignore-errors ; Again, without Eask-file needed! - (if (eask-file-try-load "../") + (if (eask-file-try-load "./") (eask-msg "✓ Loading global Eask file in %s... done!" eask-file) (eask-msg "✗ Loading global Eask file... missing!"))) (eask-msg "")) diff --git a/test/fixtures/home/Eask b/test/fixtures/home/Eask index 4227de62..f0b6d57e 100644 --- a/test/fixtures/home/Eask +++ b/test/fixtures/home/Eask @@ -1,6 +1,6 @@ -(package "mini.eask" +(package "home" "0.0.1" - "Minimal test .eask") + "Minimal test for global config") (website-url "https://github.com/emacs-eask/mini.eask") (keywords "test")