public createOutputFilePath()

in BuildTasks/PublishExtension/vsixeditor.ts [22:42]


    public createOutputFilePath(outputPath: string): string {
        const fileName = `${this.publisher}.${this.id}-${this.version}.gen.vsix`;

        const updateFileName = (fileName: string, iteration: number) => {
            if (iteration > 0) {
                const gen = iteration.toString().padStart(2, "0");
                fileName = `${this.publisher}.${this.id}-${this.version}.gen${gen}.vsix`;
            }
            fs.exists(path.join(outputPath, fileName), result => {
                if (result) {
                    updateFileName(fileName, ++iteration);
                } else {
                    tl.debug("Generated filename: " + fileName);
                }
            });
        };

        updateFileName(fileName, 0);

        return fileName;
    }