createLinuxIcons function

void createLinuxIcons({
  1. required String imagePath,
})

Start create linux icons

Implementation

void createLinuxIcons({required String imagePath}) {
  CliLogger.info('Creating Linux icons...');

  final image = Icon.loadFile(imagePath);
  if (image == null) {
    CliLogger.error('The file $imagePath could not be read.',
        level: CliLoggerLevel.two);
    exit(1);
  }

  final template = LinuxIconTemplate(name: LINUX_DEFAULT_ICON_NAME, size: 256);
  _saveImageLinux(template, image, LINUX_DEFAULT_ICON_FILE_NAME);

  CliLogger.success('Generated app icon image', level: CliLoggerLevel.two);
  // If not existed => Create new once
  // Otherwise not do anything just update icon file above
  final file = File('$LINUX_DEFAULT_ICON_DIR$LINUX_DEFAULT_ICON_NAME.desktop');
  if (!file.existsSync()) {
    _createLinuxDesktopFile();
    CliLogger.success('Created desktop entry file', level: CliLoggerLevel.two);
  }
}