Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use posix relative at templates #23693

Merged
merged 1 commit into from
Sep 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading