<commit_before>
import { relative, resolve, win32 } from 'path';

import { readdirAsync, lstatAsync } from 'fs-extra-promise';

const globby = require('globby');

export interface INsisComposerOptions {

    // Basic.
    appName: string;
    companyName: string;
    description: string;
    version: string;
    copyright: string;

    // Compression.
    compression: 'zlib' | 'bzip2' | 'lzma';
    solid: boolean;

    // Files.
    srcDir?: string;

    // Output.
    output: string;

}

export class NsisComposer {

    public static DIVIDER = '################################################################################';

    protected fixedVersion: string;

    constructor(protected options: INsisComposerOptions) {

        if(!this.options.appName) {
            throw new Error('ERROR_NO_APPNAME');
        }

        if(!this.options.companyName) {
            throw new Error('ERROR_NO_COMPANYNAME');
        }

        if(!this.options.description) {
            throw new Error('ERROR_NO_DESCRIPTION');
        }

        if(!this.options.version) {
            throw new Error('ERROR_NO_VERSION');
        }

        if(!this.options.copyright) {
            throw new Error('ERROR_NO_COPYRIGHT');
        }

        this.options.compression = this.options.compression || 'lzma';
        this.options.solid = this.options.solid ? true : false;

        this.fixedVersion = this.fixVersion(this.options.version);

    }

    public async make(): Promise<string> {

        return `${ NsisComposer.DIVIDER }
#<commit_msg>fix(nsis-gen): set warning values instead of throwing exceptions<commit_after>
import { relative, resolve, win32 } from 'path';

import { readdirAsync, lstatAsync } from 'fs-extra-promise';

const globby = require('globby');

export interface INsisComposerOptions {

    // Basic.
    appName: string;
    companyName: string;
    description: string;
    version: string;
    copyright: string;

    // Compression.
    compression: 'zlib' | 'bzip2' | 'lzma';
    solid: boolean;

    // Files.
    srcDir?: string;

    // Output.
    output: string;

}

export class NsisComposer {

    public static DIVIDER = '################################################################################';

    protected fixedVersion: string;

    constructor(protected options: INsisComposerOptions) {

        if(!this.options.appName) {
            this.options.appName = 'NO_APPNAME';
        }

        if(!this.options.companyName) {
            this.options.companyName = 'NO_COMPANYNAME';
        }

        if(!this.options.description) {
            this.options.description = 'NO_DESCRIPTION';
        }

        if(!this.options.version) {
            this.options.version = 'NO_VERSION';
        }

        if(!this.options.copyright) {
            this.options.copyright = 'ERROR_NO_COPYRIGHT';
        }

        this.options.compression = this.options.compression || 'lzma';
        this.options.solid = this.options.solid ? true : false;

        this.fixedVersion = this.fixVersion(this.options.version);

    }

    public async make(): Promise<string> {

        return `${ NsisComposer.DIVIDER }
#
{'fraction_non_alphanumeric': 0.16460513796384396, 'fraction_numerical': 0.0019029495718363464, 'mean_word_length': 2.596351197263398, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '906683', 'n_tokens_mistral': 921, 'n_tokens_neox': 878, 'n_words': 180}