Skip to content

Commit

Permalink
Release 0.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
jellesiderius committed Jul 17, 2021
1 parent 57ae0d6 commit e3a2d23
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 17 deletions.
19 changes: 16 additions & 3 deletions config/databases/production.json.sample
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
{
"databases": {
"username-1-placeholder": {
"username": "example",
"username": "example1",
"password": "",
"server": "example.io",
"domainFolder": "example.io",
"server": "example1.io",
"domainFolder": "example1.io",
"port": "2222",
"localProjectFolder": "",
"externalProjectFolder": "",
"externalPhpPath": "",
"localProjectUrl": "example1.development"
"wordpress": false
},
"username-2-placeholder": {
"username": "example2",
"password": "",
"server": "example2.io",
"domainFolder": "example2.io",
"port": "2222",
"localProjectFolder": "",
"externalProjectFolder": "",
"externalPhpPath": "",
"localProjectUrl": "example2.development"
"wordpress": false
}
}
Expand Down
19 changes: 16 additions & 3 deletions config/databases/staging.json.sample
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
{
"databases": {
"username-1-placeholder": {
"username": "example",
"username": "example1",
"password": "",
"server": "example.io",
"domainFolder": "example.io",
"server": "example1.io",
"domainFolder": "example1.io",
"port": "2222",
"localProjectFolder": "",
"externalProjectFolder": "",
"externalPhpPath": "",
"localProjectUrl": "example1.development"
"wordpress": false
},
"username-2-placeholder": {
"username": "example2",
"password": "",
"server": "example2.io",
"domainFolder": "example2.io",
"port": "2222",
"localProjectFolder": "",
"externalProjectFolder": "",
"externalPhpPath": "",
"localProjectUrl": "example2.development"
"wordpress": false
}
}
Expand Down
4 changes: 4 additions & 0 deletions dist/controllers/importController.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/importController.js.map

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions dist/models/databasesModel.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/models/databasesModel.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.2.4",
"version": "0.2.5",
"description": "Database synchronizer for Magento, based on Magerun",
"author": {
"name": "Jelle Siderius"
Expand Down
6 changes: 5 additions & 1 deletion src/controllers/importController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ class ImportController {
// Set current folder name based on current folder
this.currentFolderName = path.basename(path.resolve(this.currentFolder));

this.magentoLocalhostDomainName = this.currentFolderName + configFile.general.localDomainExtension
this.magentoLocalhostDomainName = this.currentFolderName + configFile.general.localDomainExtension;
if (this.databases.databaseData.localProjectUrl) {
this.magentoLocalhostDomainName = this.databases.databaseData.localProjectUrl;
}

// Check if current folder is Magento
var currentFolderIsMagento = false;
Expand All @@ -186,6 +189,7 @@ class ImportController {
}
)

// @ts-ignore
if (this.databases.databaseData.wordpress && this.databases.databaseData.wordpress == true) {
// Add wordpress download and import option if server config has it
this.databaseConfigurationQuestions.push(
Expand Down
18 changes: 15 additions & 3 deletions src/models/databasesModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,18 @@ import productionDatabases from "../../config/databases/production.json";

class DatabasesModel {
public databasesList: { [k: string]: any } = [];
public databaseData: { [k: string]: any } = {};
public databaseData = {
'username': '',
'password': '',
'server': '',
'domainFolder': '',
'port': 22,
'localProjectFolder': '',
'externalProjectFolder': '',
'wordpress': false,
'externalPhpPath': '',
'localProjectUrl': ''
};

// Collect databases | collect single database
collectDatabaseData = async (databaseKey: string | void, databaseType: string | void ) => {
Expand All @@ -25,15 +36,16 @@ class DatabasesModel {
this.databaseData.password = database.password;
this.databaseData.server = database.server;
this.databaseData.domainFolder = database.domainFolder;
this.databaseData.port = database.port;
// @ts-ignore
this.databaseData.port = database.port;
this.databaseData.localProjectFolder = database.localProjectFolder;
// @ts-ignore
this.databaseData.externalProjectFolder = database.externalProjectFolder;
// @ts-ignore
this.databaseData.wordpress = database.wordpress;
// @ts-ignore
this.databaseData.externalPhpPath = database.externalPhpPath
// @ts-ignore
this.databaseData.localProjectUrl = database.localProjectUrl
} else {
// Collect all database
this.databasesList.push(`${database.domainFolder} / ${database.username} (${key})`);
Expand Down

0 comments on commit e3a2d23

Please sign in to comment.