Skip to content

Commit f1b371d

Browse files
committed
fix: get rid of full pathname when loading fixtures templates
1 parent 5ee70f4 commit f1b371d

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsPackageFixturesGeneratorIntegration.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;
2626
import software.amazon.smithy.utils.IoUtils;
2727

28-
2928
public class AwsPackageFixturesGeneratorIntegration implements TypeScriptIntegration {
3029
@Override
3130
public void writeAdditionalFiles(
@@ -35,24 +34,20 @@ public void writeAdditionalFiles(
3534
BiConsumer<String, Consumer<TypeScriptWriter>> writerFactory
3635
) {
3736
writerFactory.accept(".gitignore", writer -> {
38-
String resource = IoUtils.readUtf8Resource(
39-
getClass().getClassLoader(), "software/amazon/smithy/aws/typescript/codegen/gitignore");
37+
String resource = IoUtils.readUtf8Resource(getClass(), "gitignore");
4038
writer.write(resource);
4139
});
4240
writerFactory.accept(".npmignore", writer -> {
43-
String resource = IoUtils.readUtf8Resource(
44-
getClass().getClassLoader(), "software/amazon/smithy/aws/typescript/codegen/npmignore");
41+
String resource = IoUtils.readUtf8Resource(getClass(), "npmignore");
4542
writer.write(resource);
4643
});
4744
writerFactory.accept("LICENCE", writer -> {
48-
String resource = IoUtils.readUtf8Resource(
49-
getClass().getClassLoader(), "software/amazon/smithy/aws/typescript/codegen/LICENCE.template");
45+
String resource = IoUtils.readUtf8Resource(getClass(), "LICENCE.template");
5046
resource = resource.replace("${year}", Integer.toString(Calendar.getInstance().get(Calendar.YEAR)));
5147
writer.write(resource);
5248
});
5349
writerFactory.accept("README.md", writer -> {
54-
String resource = IoUtils.readUtf8Resource(
55-
getClass().getClassLoader(), "software/amazon/smithy/aws/typescript/codegen/README.md.template");
50+
String resource = IoUtils.readUtf8Resource(getClass(), "README.md.template");
5651
resource = resource.replaceAll("\\$\\{packageName\\}", settings.getPackageName());
5752
writer.write(resource);
5853
});

0 commit comments

Comments
 (0)