Closed vexorian closed 10 years ago
Sure. This can be done. So one of your design goal is to make the backup in other directory? Like somewhere else under the workspace?
Also, better rename the filename
to fileName
, and
this backup config is at the root level of config, right?
Like
greed {
backup {
...
}
}
I'm busy with other stuff recently. If you've got time, you can take some time to implement this.
I decided that at least for now allowing custom folders was too much trouble for the benefit. But this PR allows changing the format of the backup file name.
Now that there is a backup section in config, we might as well allow to change the backup limit as opposed to hard coded BACKUP_NUM
Squashed the commits now that I managed to customize folder too.
Cool!
Cool!
I think it is great greed saves backups of files it overrides. But I would like to be able to customize the file name. It would be specially useful to be able to use .filename.bak.0, so that the file is hidden. Let's agree on config syntax.
This reuses the GeneratedFileName that is used for after gen hooks.
It is possible to use folder structures. But backup folder structure needs to be a subfolder of the place where the file is getting generated:
backup.fileName = "backups/${GeneratedFileName}.${BackupNumber}"
Works.