Using a generic package for project setup, like a code dojo

Trying to reduce the difficulty to do a code dojo using elisp. by using a common project.

This should be generic enough to work for most projects in windows.

This is before having source countrol. You will ruin .git or .svn if the generic package you download has it.

Downloading and renaming the standard project

Common function for rename files and content

Function Replace-File-And-Content {
    param(
	[Parameter(Mandatory = $true)][string] $match,
	[Parameter(Mandatory = $true)][string] $replacement
    )
    Get-ChildItem -Recurse "*$match*" |
	Sort-Object -Descending -Property { $_.FullName } |
	Rename-Item -NewName { $_.name -replace $match, $replacement } -Force

    Get-ChildItem $(get-location) -Recurse -File | % {
	((Get-Content $_.fullname) -creplace $match, $replacement) | Set-Content $_.fullname
    }
}

Download, unzip, rename

This needs 7Zip on the path and will

# Invoke-WebRequest https://bitbucket.org/sreal/sim-frost/get/0.0.1.tar.gz -OutFile 0.0.1.tar.gz;
# cp ~/Downloads/0.0.1.tar.gz -Force  # Or use a common local version.
7z x -r -aoa 0.0.1.tar.gz; rm 0.0.1.tar.gz;
7z x -r -aoa 0.0.1.tar; rm 0.0.1.tar;
mv sreal-sim-frost-* dojo-name
cd dojo-name
Replace-File-And-Content "sim-frost" "dojo-name"

Or just wrap it in a pretty bow.

Function Setup-Elisp-Project {
    param(
	[Parameter (Mandatory = $true)][string] $dojoName
    )
    cp ~/Downloads/0.0.1.tar.gz -Force  # Or use a common local version.
    7z x -r -aoa 0.0.1.tar.gz; rm 0.0.1.tar.gz;
    7z x -r -aoa 0.0.1.tar; rm 0.0.1.tar;
    mv sreal-sim-frost-* $dojoName
    cd $dojoName
    Replace-File-And-Content "sim-frost" "$dojoName"
}

if you're using the Docker, Emacs, & Ecukes

Installing the packages is also needed by running this in the debian docker machine.

cask install
# and this should now work..
cask exec ecukes --reporter magnars;