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
# 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
#
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()
{
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"
}