Verified Commit 54dd4b61 authored by Aral Balkan's avatar Aral Balkan
Browse files

Zip up the source and clean up in the build script

parent 623110fc
......@@ -24,6 +24,14 @@ fs.mkdirSync(linuxVersionPath, {recursive: true})
fs.mkdirSync(macOSVersionPath, {recursive: true})
async function build () {
//
// Zip the source.
//
console.log(' • Zipping up the source for inclusion in the binary…')
const mainSourceDirectory = path.join(__dirname, '..')
childProcess.execSync(String.raw`rm -f web-server.zip && zip web-server.zip * -x \*.git\* \*dist-iws\* -r`, {env: process.env, cwd: mainSourceDirectory})
//
// Build.
//
......@@ -49,8 +57,8 @@ async function build () {
console.log(' • Zipping binaries…')
const zipFileName = `${version}.zip`
const linuxVersionWorkingDirectory = path.join(__dirname, '..', linuxVersionPath)
const macOSVersionWorkingDirectory = path.join(__dirname, '..', macOSVersionPath)
const linuxVersionWorkingDirectory = path.join(mainSourceDirectory, linuxVersionPath)
const macOSVersionWorkingDirectory = path.join(mainSourceDirectory, macOSVersionPath)
childProcess.execSync(`zip ${zipFileName} web-server`, {env: process.env, cwd: linuxVersionWorkingDirectory})
childProcess.execSync(`zip ${zipFileName} web-server`, {env: process.env, cwd: macOSVersionWorkingDirectory})
......@@ -58,6 +66,17 @@ async function build () {
//
// Copy to web site.
//
// Note: this requires a relative directory setup that matches what I have on my
// ===== development machine (remember we are running in web-server/bin/):
//
// |
// |- site <- Ind.ie Web Site source
// |_www/content/web-server/
// |- hypha
// |_ web-server <- This project
//
// If it cannot find the Ind.ie Web Site, the build script will just skip this step.
//
const pathToWebServerSectionOfSite = path.join(__dirname, '../../../site/www/content/web-server/')
// Check that the local working copy of the Indie Web Site exists at the relative location
......@@ -78,6 +97,10 @@ async function build () {
console.log(' • Skipped copy of binaries to Indie Web Site as could not find the local working copy.')
}
console.log(' • Cleaning up…')
childProcess.execSync('rm -f web-server.zip', {env: process.env, cwd: mainSourceDirectory})
console.log('\n 😁👍 Done!\n')
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment