Skip to content

Instantly share code, notes, and snippets.

@hkoba
Created June 14, 2022 09:07
Show Gist options
  • Save hkoba/1347c465bad0a17b1c0ac48e318fed9b to your computer and use it in GitHub Desktop.
Save hkoba/1347c465bad0a17b1c0ac48e318fed9b to your computer and use it in GitHub Desktop.
melpa のパッケージを、指定ディレクトリにインストールする実験
#!/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)"
@hkoba
Copy link
Author

hkoba commented Jun 14, 2022

https://gist.github.com/knishioka/4578f62e82f90f958fb30da4db557078 を参考に、自分の欲しい形へ tcl で書き直し

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment