From: W. Trevor King Date: Fri, 4 Apr 2014 15:35:57 +0000 (-0700) Subject: swc-windows-installer.sh: Install the sqlite3 shell X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=refs%2Fheads%2Fshell;p=swc-setup-windows-installer.git swc-windows-installer.sh: Install the sqlite3 shell On Thu, Apr 03, 2014 at 09:38:38AM -0700, Ethan White wrote: > Some instructors like to teach `sqlite` from the command > line. Therefore we should have the Windows installer handle > downloading, installing and adding sqlite3 to the path. The novice/sql lessons currently revolve around some IPython magic, but even they use the SQLite shell to do the initial database setup [1]. The SQLite shell has also seen a bit more developer time than our one-off magic [2], so it's probably more robust ;). I've installed this in it's own directory (rather than just dumping it into ~/.swc/bin), because zip_install uses the existence of ${INSTALL_DIRECTORY} to decide whether or not the installation has already happened. create_nosetests_entry_point will have already created ${BIN_DIR}, so we need to use a different target directory for SQLite. We could also flip the order and run install_sqlite first, but that doesn't scale well if we install more packages in the future, and it's easier to keep the installs separate and keep adding to the path. [1]: https://github.com/swcarpentry/bc/blob/1aa0799ac6a48e9815d50bf2f49171b9eb5bf6d4/novice/sql/README.txt#L8 [2]: https://github.com/swcarpentry/bc/blob/1aa0799ac6a48e9815d50bf2f49171b9eb5bf6d4/novice/sql/sqlitemagic.py --- diff --git a/swc-windows-installer.sh b/swc-windows-installer.sh index a8d6931..7bcdd09 100755 --- a/swc-windows-installer.sh +++ b/swc-windows-installer.sh @@ -7,6 +7,7 @@ # The script: # * Installs nano and makes it accessible from msysGit # * Creates ~/nano.rc with links to syntax highlighting configs +# * Installs sqlite3 and makes it accessible from msysGit # * Provides standard nosetests behavior (if Python and the nose # module are installed) for msysGit # @@ -105,6 +106,14 @@ install_nanorc() fi } +install_sqlite() +{ + INSTALL_DIRECTORY="${1}" + zip_install 'https://sqlite.org/2014/sqlite-shell-win32-x86-3080403.zip' \ + '09ba6646cb0a57eab11c8bab7caec854' \ + "${INSTALL_DIRECTORY}" +} + # Creates a terminal-based nosetests entry point for msysGit create_nosetests_entry_point() { @@ -166,10 +175,13 @@ main() BIN_DIR="${SWC_DIR}/bin" NANO_DIR="${SWC_DIR}/lib/nano" NANORC_DIR="${SWC_DIR}/share/nanorc" + SQLITE_DIR="${SWC_DIR}/lib/sqlite" create_nosetests_entry_point "${BIN_DIR}" || die "couldn't create nosetests" install_nano "${NANO_DIR}" || die "couldn't install nano" install_nanorc "${NANORC_DIR}" || die "couldn't install nanorc" - add_swc_paths "${NANO_DIR}" "${BIN_DIR}" || die "couldn't add SWC paths" + install_sqlite "${SQLITE_DIR}" || die "couldn't install sqlite" + add_swc_paths "${NANO_DIR}" "${SQLITE_DIR}" "${BIN_DIR}" || + die "couldn't add SWC paths" set_default_editor nano || die "couldn't set EDITOR" }