Skip to content

Commit

Permalink
fix: Rewriting of licenses.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed Aug 25, 2023
1 parent f841304 commit ff54be2
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions packages/katana_cli/lib/command/create.dart
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ class CreateCliCommand extends CliCommand {
await KatanaCliCode(context.args.get(2, "") == "-a" ||
context.args.get(2, "") == "-e")
.generateFile("katana.yaml");
label("Replace LICENSE");
await const LicenseCliCode().generateFile("LICENSE");
label("Create a katana_secrets.yaml");
await const KatanaSecretsCliCode().generateFile("katana_secrets.yaml");
label("Create a pubspec_overrides.yaml");
Expand Down Expand Up @@ -2227,3 +2229,65 @@ scripts:
""";
}
}

/// Contents of LICENSE.
///
/// LICENSEの中身。
class LicenseCliCode extends CliCode {
/// Contents of LICENSE.
///
/// LICENSEの中身。
const LicenseCliCode();

@override
String get name => "LICENSE";

@override
String get prefix => "LICENSE";

@override
String get directory => "";

@override
String get description => "Define LICENSE. LICENSEを定義します。";

@override
String import(String path, String baseName, String className) {
return "";
}

@override
String header(String path, String baseName, String className) {
return "";
}

@override
String body(String path, String baseName, String className) {
return """
Copyright (c) 2021, mathru (https://mathru.net)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the <organization> nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
""";
}
}

0 comments on commit ff54be2

Please sign in to comment.