Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Hypha
Tools
Indie Web Server
Commits
54dd4b61
Verified
Commit
54dd4b61
authored
Apr 09, 2019
by
Aral Balkan
Browse files
Zip up the source and clean up in the build script
parent
623110fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/build.js
View file @
54dd4b61
...
...
@@ -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
'
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment