Developer's Diary
Software development, with Terry Ebdon
|
The excludes section in my backup script is getting quite large:
A list like this should really be in configuration, not code. I can move the excludes into an excludes file. This is more manageable and would make it easy to switch between different exclude lists, if needed. This would be useful for backing up different folder trees with the same code.
The backupExcludes.txt
file has one pattern per line:
The hard-coded file name is a bit smelly, let's get rid of it. Currently all configuration for Backup.groovy
is in the code, but all other classes use Groovy's ConfigSlurper
to load it from config.groovy
at run-time.
I've added the excludes file name to config.groovy
:
The Backup
class needs to load the configuration:
Then use it in the FileSet's excludesfile attribute:
The Windows set
command allows environment variables to be created with spaces in the value string. There's no need to escape the spaces or quote the string:
Spaces are a problem for the setx
command though. Unfortunately setx
gives a confusing error message; it's not obvious that the space is the problem:
Surrounding the value with quotation marks solves the problem:
Yesterday Eclipse had problems running Groovy projects that use AntBuilder. This was easily fixed. Eclipse is using the embeddable Groovy jar, which doesn't include all the standard libraries. Adding the following three external dependencies to the build path resolves this: - ant-1.9.4.jar - ant-launcher-1.9.4.jar - commons-cli-1.2.jar
The commons-cli-1.2 jar is required to use Groovy's useful CliBuilder class.
The WebDoxy project has become non-trivial, so really should be in a cloud-based source control. Time to dust-off my BitBucket account. One advantage of Atlassian BitBucket is support for both Git and Mercurial. I've always used Mercurial as, at least in the past, it was said to have better integration on Microsoft Windows. The machine I'm currently using doesn't have Hg installed, so the combined Mercurial and TortoiseHg package seems the way to go.
I've been trying various versions of [hello world](https://example.com/hello.md)
. They all display as https://example.com/hello.md "hello world"
, where the URL is not rendered as a link. It's very odd. So far I've only seen the link work when it's a straight URL, with no markdown sugar, or the ".md" is removed.
The work-around is to use a HTML anchor.
Find me coding on GitHub, networking on LinkedIn, answering questions on Stack Exchange and hanging out on twitter.