Skip to content

Commit

Permalink
Release 0.5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
jellesiderius committed Jun 2, 2022
1 parent a690476 commit c28a825
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/controllers/mainController.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/controllers/mainController.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions dist/questions/configurationQuestions.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/questions/configurationQuestions.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions dist/tasks/importTask.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/tasks/importTask.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mage-db-sync",
"version": "0.5.6",
"version": "0.5.7",
"description": "Database synchronizer for Magento, based on Magerun",
"author": {
"name": "Jelle Siderius"
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/mainController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class MainController {
'currentFolder': '',
'currentFolderName': '',
'strip': '',
'syncImages': false,
'syncImages': 'no',
'magentoLocalhostDomainName': '',
'rsyncInstalled': false,
'elasticSearchUsed': false,
Expand Down Expand Up @@ -91,4 +91,4 @@ class MainController {
}
}

export default MainController
export default MainController
22 changes: 21 additions & 1 deletion src/questions/configurationQuestions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ class ConfigurationQuestions {
// Set import setting for Magento
config.settings.import = answers.import

if (config.settings.rsyncInstalled) {
// Set image import setting for Shopware
config.settings.syncImages = answers.syncImages
}

// Set wordpress download value
config.settings.wordpressDownload = answers.wordpressDownload

Expand Down Expand Up @@ -80,6 +85,21 @@ class ConfigurationQuestions {
);
}

if (config.settings.rsyncInstalled) {
this.questionsOne.push(
{
type: 'list',
name: 'syncImages',
default: 'yes',
message: 'Synchronize media images?',
choices: ['yes', 'no'],
validate: (input: string) => {
return false;
},
}
);
}

if (config.databases.databaseData.wordpress) {
this.questionsOne.push(
{
Expand Down Expand Up @@ -112,4 +132,4 @@ class ConfigurationQuestions {
}
}

export default ConfigurationQuestions
export default ConfigurationQuestions
12 changes: 12 additions & 0 deletions src/tasks/importTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ class ImportTask {
}
);

if (config.settings.syncImages == 'yes') {
this.importTasks.push(
{
title: 'Synchronizing media images',
task: async (): Promise<void> => {
// Sync media
await localhostMagentoRootExec(`rsync -avz -e "ssh -p ${config.databases.databaseData.port}" ${config.databases.databaseData.username}@${config.databases.databaseData.server}:${config.serverVariables.magentoRoot}/pub/media/* pub/media/ --exclude 'cache' --exclude 'catalog/product/cache' --exclude 'catalog/category/cache' --exclude 'custom_options' --exclude 'tmp' --exclude 'analytics'`, config, true);
}
}
);
}

this.importTasks.push(
{
title: 'Cleaning up',
Expand Down

0 comments on commit c28a825

Please sign in to comment.