Skip to content

Commit

Permalink
Merge pull request #104 from czprz/103-cannot-run-as-hash-checker-req…
Browse files Browse the repository at this point in the history
…uires-projectlocation-with-deverjson

#103 Cannot run as 'hash-checker' requires 'project.location' with 'dever.json'
  • Loading branch information
czprz authored Jun 27, 2022
2 parents 23b4030 + 264f639 commit 859a397
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bin/common/default-yargs-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default new class {
console.log(`Use 'dever validate -f [filePath]' to find out why they're unsupported`);

for (const project of projects) {
console.log(`${chalk.green(project.location)}`);
console.log(`${chalk.green(project.location.full)}`);
}
}

Expand Down
4 changes: 2 additions & 2 deletions bin/common/helper/hash-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default new class {
return true;
}

return project.lastHash === this.#getHash(project.location);
return project.lastHash === this.#getHash(project.location.full);
}

/**
Expand All @@ -23,7 +23,7 @@ export default new class {
*/
update(project) {
projectConfigFacade.update(project.id, (local) => {
local.lastHash = this.#getHash(project.location);
local.lastHash = this.#getHash(project.location.full);
});
}

Expand Down
14 changes: 13 additions & 1 deletion bin/common/models/internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class Project {
install;

/**
* @type {string}
* @type {Location}
*/
location;

Expand Down Expand Up @@ -145,4 +145,16 @@ class ExecutionConfig extends ExecutionRunConfig {
* @type {ExecutionRunConfig} @optional
*/
stop;
}

export class Location {
/**
* @type {string} @required
*/
full;

/**
* @type {string} @required
*/
partial;
}
5 changes: 4 additions & 1 deletion bin/configuration/facades/project-config-facade.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ export default new class {
return {
...projectConfig,
id: id,
location: path.dirname(project.path),
location: {
full: project.path,
partial: path.dirname(project.path)
},
lastHash: project.lastHash,
skipHashCheck: config.skipAllHashChecks || project.skipHashCheck || false,
supported: versionChecker.supportedVersion(projectConfig?.version ?? 0),
Expand Down
2 changes: 1 addition & 1 deletion bin/configuration/handlers/project-config-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default new class {
return;
}

console.log(project.location);
console.log(project.location.full);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions bin/environments/executions/docker-compose/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ export default new class {
handle(project, execution, runtime) {
switch (true) {
case runtime.start:
this.#start(execution, project.location, runtime);
this.#start(execution, project.location.partial, runtime);
break;
case runtime.stop:
this.#stop(execution, project.location);
this.#stop(execution, project.location.partial);
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion bin/environments/executions/powershell-script/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default new class {
}

try {
const file = path.join(project.location, execution.file);
const file = path.join(project.location.partial, execution.file);
const fileWithParameters = customOptions.addOptionsToFile(file, execution.options, runtime.args);
await powershell.executeFileSync(fileWithParameters, execution.runAsElevated);

Expand Down
4 changes: 2 additions & 2 deletions 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": "@czprz/dever",
"version": "0.11.4-beta",
"version": "0.11.5-beta",
"description": "Development Helper (dev-er) to speed up and keep local development environment consistent",
"author": "Casper Overholm Elkrog",
"keywords": [
Expand Down

0 comments on commit 859a397

Please sign in to comment.