Created
June 14, 2022 09:07
-
-
Save hkoba/1347c465bad0a17b1c0ac48e318fed9b to your computer and use it in GitHub Desktop.
melpa のパッケージを、指定ディレクトリにインストールする実験
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/tclsh | |
package require fileutil | |
proc RUN args { | |
puts "# $args" | |
exec {*}$args >@ stdout 2>@ stderr | |
} | |
if {$argv eq ""} { | |
error "Usage: $0 DEST_DIR PACKAGES..." | |
} | |
set argv [lassign $argv destDir] | |
set destDir [fileutil::fullnormalize $destDir] | |
set lisp [subst { | |
(require 'package) | |
(add-to-list 'package-archives | |
'("melpa" . "https://melpa.org/packages/") t) | |
(setq package-user-dir "$destDir") | |
(package-refresh-contents) | |
(package-initialize) | |
}] | |
foreach pkg $argv { | |
append lisp [subst { (package-install '$pkg)\n}] | |
} | |
RUN emacs -q --batch --eval "(progn $lisp)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://gist.github.com/knishioka/4578f62e82f90f958fb30da4db557078 を参考に、自分の欲しい形へ tcl で書き直し