Skip to content

Commit

Permalink
Merge pull request #23693 from jhipster/skip_ci-relative
Browse files Browse the repository at this point in the history
use posix relative at templates
  • Loading branch information
DanielFran authored Sep 30, 2023
2 parents d15f1e8 + 9b826de commit 1c53df4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions generators/base-core/generator.mts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* limitations under the License.
*/
import { basename, join as joinPath, dirname, relative, isAbsolute, join, extname } from 'path';
import { relative as posixRelative } from 'path/posix';
import { createHash } from 'crypto';
import { fileURLToPath } from 'url';
import { statSync, rmSync, existsSync, readFileSync } from 'fs';
Expand Down Expand Up @@ -66,7 +67,7 @@ const __dirname = dirname(__filename);
const asPriority = (priorityName: string) => `${PRIORITY_PREFIX}${priorityName}`;

const relativeDir = (from: string, to: string) => {
const rel = relative(from, to);
const rel = posixRelative(from, to);
return rel ? `${rel}/` : '';
};

Expand Down Expand Up @@ -106,7 +107,7 @@ export default class CoreGenerator extends YeomanGenerator<JHipsterGeneratorOpti
debugEnabled?: boolean;
jhipster7Migration?: boolean;
relativeDir = relativeDir;
relative = relative;
relative = posixRelative;

readonly sharedData!: SharedData<CommonClientServerApplication>;
readonly logger: Logger;
Expand Down

0 comments on commit 1c53df4

Please sign in to comment.