mirror of
https://github.com/nextcloud/server.git
synced 2026-04-24 07:39:23 -04:00
Merge pull request #45889 from nextcloud/fix/noid/cypress-local-changes
This commit is contained in:
commit
ae4a64b724
1 changed files with 20 additions and 3 deletions
|
|
@ -9,7 +9,9 @@
|
|||
import Docker from 'dockerode'
|
||||
import waitOn from 'wait-on'
|
||||
import tar from 'tar'
|
||||
import path from 'path'
|
||||
import { execSync } from 'child_process'
|
||||
import { existsSync } from 'fs'
|
||||
|
||||
export const docker = new Docker()
|
||||
|
||||
|
|
@ -129,7 +131,6 @@ export const configureNextcloud = async function() {
|
|||
*/
|
||||
export const applyChangesToNextcloud = async function() {
|
||||
console.log('\nApply local changes to nextcloud...')
|
||||
const container = docker.getContainer(CONTAINER_NAME)
|
||||
|
||||
const htmlPath = '/var/www/html'
|
||||
const folderPaths = [
|
||||
|
|
@ -151,10 +152,26 @@ export const applyChangesToNextcloud = async function() {
|
|||
'./version.php',
|
||||
]
|
||||
|
||||
folderPaths.forEach((path) => {
|
||||
console.log(`├─ Copying ${path}`)
|
||||
let needToApplyChanges = false
|
||||
|
||||
folderPaths.forEach((folderPath) => {
|
||||
const fullPath = path.join(htmlPath, folderPath)
|
||||
|
||||
if (existsSync(fullPath)) {
|
||||
needToApplyChanges = true
|
||||
console.log(`├─ Copying ${folderPath}`)
|
||||
}
|
||||
})
|
||||
|
||||
// Don't try to apply changes, when there are none. Otherwise we
|
||||
// still execute the 'chown' command, which is not needed.
|
||||
if (!needToApplyChanges) {
|
||||
console.log('└─ No local changes found to apply')
|
||||
return
|
||||
}
|
||||
|
||||
const container = docker.getContainer(CONTAINER_NAME)
|
||||
|
||||
// Tar-streaming the above folders into the container
|
||||
const serverTar = tar.c({ gzip: false }, folderPaths)
|
||||
await container.putArchive(serverTar, {
|
||||
|
|
|
|||
Loading…
Reference in a new issue