aws / codecatalyst-blueprints

Apache License 2.0
50 stars 19 forks source link

SourceRepository.copyStaticFiles() removes dots ('.') from filenames #474

Closed gchagnon closed 8 months ago

gchagnon commented 8 months ago

Describe the bug

Any files that are copied from static-assets via SourceRepository.copyStaticFiles() get the '.' characters stripped out of their filename. For example, build.gradle becomes buildgradle.

My code:

const repository = new SourceRepository(this, { title: options_.capabilityName });
repository.copyStaticFiles({
  substitute: {
    capabilityName: options_.capabilityName,
    serviceName: options_.capabilityName.charAt(0).toUpperCase() + options_.capabilityName.slice(1) + 'Service',
    moduleDescription: options_.capabilityDescription,
    industry: options_.industry.toLowerCase(),
    capability: options_.capabilityName.toLowerCase(),
  },
},
    );

Steps to reproduce

Steps to reproduce the behavior:

  1. Create a blueprint that has a file in static-assets with a string substitution in it, e.g. {{productName}}.
  2. Use the following to create a repo and substitute productName:
    const repository = new SourceRepository(this, { title: 'code' });
    repository.copyStaticFiles({
      substitute: {
        productName: 'test'
      },
    },
    );

Create a new project from this blueprint.

Expected / Actual Behavior

Expected: File names are preserved Actual: '.' chars are stripped

Version information

Additional context

See screenshot image

alexforsyth commented 8 months ago

Nice catch! We'll investigate

aggagen commented 8 months ago

We released a fix to properly handle file names with .s in version 0.3.55 of @amazon-codecatalyst/blueprint-component.source-repositories. Thanks for the bug report!