Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25418

Android: Module build will fail if documentation folder contains non-markdown files

    Details

    • Story Points:
      5
    • Sprint:
      2018 Sprint 06 SDK, 2018 Sprint 07 SDK, 2018 Sprint 08 SDK, 2018 Sprint 09 SDK

      Description

      When trying to compile this Android module: https://github.com/nuno/TiCollectionView the current CLI will stop at

      [INFO]  Packaging the module

      because the documentation folder (https://github.com/nuno/TiCollectionView/tree/master/android/documentation) contains images.

      The _buildModule.js tries to generate markdown out of the files at
      https://github.com/appcelerator/titanium_mobile/blob/b56b146871238abe931333ead44b5b5b027e877f/android/cli/commands/_buildModule.js

      Since I'm not sure what files are allowed in this folder a fix would be to exclude images:

      if (fs.statSync(currentFile).isFile() &&
      	currentFile.indexOf(".png") == -1 &&
      	currentFile.indexOf(".gif") == -1) {
      	var obj = {},
      		contents = fs.readFileSync(currentFile).toString();
       
      	obj[file] = markdown.toHTML(contents);
      	this.documentation.push(obj);
      }
      

      or only allow .md files (or even .txt)

      if (fs.statSync(currentFile).isFile() &&
      	(currentFile.indexOf(".md") != -1 ||
      	currentFile.indexOf(".txt") != -1)) {
      	var obj = {},
      		contents = fs.readFileSync(currentFile).toString();
       
      	obj[file] = markdown.toHTML(contents);
      	this.documentation.push(obj);
      }
      

      Ti 6.2.2.GA

        Attachments

          Activity

            People

            • Assignee:
              hknoechel Hans Knöchel
              Reporter:
              michael Michael Gangolf
              Reviewer:
              Chris Barber
              Tester:
              Samir Mohammed
            • Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Source Code