Skip to content

Commit 240752f

Browse files
committed
Final merge edits for the original Docketeer app
Co-authored-by: Abigail Gerig <[email protected]> Co-authored-by: Christian Looff <[email protected]> Co-authored-by: Ruli Warner-Rosen <[email protected]> Co-authored-by: Trine Medina <[email protected]> Co-authored-by: Matt Dias <[email protected]>
2 parents c449660 + 813a5a5 commit 240752f

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

src/components/helper/commands.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,26 @@ export const addRunning = (runningList, callback) => {
5555
* @param {*} callback
5656
* @param {*} runningList
5757
*/
58+
59+
const errorsCalled = {};
60+
61+
const errorCheck = (key, error) => {
62+
if(!errorsCalled[key]) {
63+
errorsCalled[key] = error.message;
64+
alert(`Make sure Docker Desktop is running. \n\n ${error.message}`);
65+
}
66+
else{
67+
console.log(error.message);
68+
}
69+
return
70+
}
71+
5872
export const refreshRunning = (refreshRunningContainers) => {
5973
exec(
6074
'docker stats --no-stream --format "{{json .}},"',
6175
(error, stdout, stderr) => {
6276
if (error) {
63-
alert(`${error.message}`);
77+
errorCheck("refreshRunning", error);
6478
return;
6579
}
6680
if (stderr) {
@@ -89,7 +103,7 @@ export const refreshStopped = (refreshStoppedContainers) => {
89103
'docker ps -f "status=exited" --format "{{json .}},"',
90104
(error, stdout, stderr) => {
91105
if (error) {
92-
alert(`${error.message}`);
106+
errorCheck("refreshStopped", error);
93107
return;
94108
}
95109
if (stderr) {
@@ -113,7 +127,7 @@ export const refreshStopped = (refreshStoppedContainers) => {
113127
export const refreshImages = (callback) => {
114128
exec('docker images', (error, stdout, stderr) => {
115129
if (error) {
116-
alert(`${error.message}`);
130+
errorCheck("refreshImages", error);
117131
return;
118132
}
119133
if (stderr) {

src/components/helper/initDatabase.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ config();
77
export default () => {
88
const directory =
99
process.env.NODE_ENV === 'development'
10-
? path.resolve(__dirname, '..', '..', 'database')
10+
? path.resolve(__dirname, '../../database')
1111
: path.join(path.dirname(__dirname), 'database');
1212

13-
exec(`cd src/database ; docker compose up --no-recreate --wait`, (error, stdout, stderr) => {
13+
exec(`cd ${directory} && docker compose up --no-recreate --wait -d`, (error, stdout, stderr) => {
1414
if (error) {
15-
alert(`${error.message} `);
15+
alert(`Make sure Docker Desktop is running. \n\n ${error.message} `);
1616
return;
1717
}
1818
if (stderr) {

0 commit comments

Comments
 (0)