Sublime Forum

Creating a channel

#1

Dear community,

Package control question. I’ve create a channel here with a “dummy” package; I add this channel with Package Control’s “Add Channel”, then run “Install Package”, and a dialog tells me there are no packages for installation.

How have I misconfigured this channel?

Thanks!

0 Likes

#2

The channel file looks valid to me (and package control doesn’t complain about it), but using it doesn’t add any packages to the list of packages offered for installation either. I can still see other packages and I don’t get There are no packages available for installation package unless I also remove the default channel.

So one thing to check would be to look at your Package Control.sublime-settings and make sure that channels includes both your channel and the default channel as well. While you’re in there, adding "debug": true may help determine what’s going on. You should also check the console to see if it’s generating any error messages that explain what’s going on.

Is there a specific reason that you want to create your own custom channel and not your own custom repository? For example, if you use Package Control: Add Repository instead, and paste in the JSON URL to the repository you have listed in your channel file, the package will appear.

I’m not sure why it doesn’t like the channel file (since as noted above the repository works; perhaps it expects the contents of the repository to be cached even though it seems to be listed as being optional?), but the way you appear to be trying to use the repository file to specify packages may not work the way you think it does, unless this was just initial testing and now how you pretend to proceed.

The repository file contains this:

{
    "name": "EchoCommand",
    "description": "Testing channel",
    "author": "jngk2",
    "details": "https://github.com/jngk2/st3_extra/Packages/examples/EchoCommand",
    "labels": ["text manipulation"],
    "releases": [
        {
            "sublime_text": "*",
            "details": "https://github.com/jngk2/st3_extra/tree/master"
        }
    ]
}

Disregarding that branch based releases are deprecated (which doesn’t matter in this case), this may be not be installing what you think it is.

Package Control installs packages by essentially taking these steps:

  1. Download a zipball from GitHub
  • If this is a tagged release, it downloads the “Source Code” zipball from the releases page
  • If this is a branch based release, it downloads the zipball that you get if you click the “Download Zip” button in the Clone or Download button on the page
  1. The downloaded zipball contains a top level directory based on the name of the repository and the branch or version tag (e.g. st3_extra-master or st3_extra-1.0.0) so it repackages the file to remove that top level folder, including a metadata file along the way.
  2. The result is dropped into Installed Packages as a sublime-package file.

So for the package in the repository file outlined above, it gets a file that contains your entire repository and uses it as a package:

tmartin:dart:~/.config/sublime-text-3/Installed Packages> unzip -l EchoCommand.sublime-package 
Archive:  EchoCommand.sublime-package
  Length      Date    Time    Name
---------  ---------- -----   ----
      174  02-23-2019 21:53   package-metadata.json
      893  02-23-2019 21:53   Packages/examples/GuffInsertions/Main.sublime-menu
      327  02-23-2019 21:53   Packages/examples/GuffInsertions/insert_guff.py
      477  02-23-2019 21:53   Packages/examples/GuffInsertions/Makefile
      519  02-23-2019 21:53   Packages/examples/OpenInBrowserCommand/open_in_browser.py
      386  02-23-2019 21:53   Packages/examples/MoreCommands/Makefile
      814  02-23-2019 21:53   Packages/examples/MoreCommands/more_commands.py
      942  02-23-2019 21:53   Packages/examples/GotoLineCommand/goto_line.py
     8649  02-23-2019 21:53   Packages/examples/CommentCommand/comment.py
      773  02-23-2019 21:53   Packages/examples/PythonProjectInit/README.md
      249  02-23-2019 21:53   Packages/examples/PythonProjectInit/Side Bar.sublime-menu
      480  02-23-2019 21:53   Packages/examples/PythonProjectInit/Makefile
    11325  02-23-2019 21:53   Packages/examples/PythonProjectInit/LICENSE
     1687  02-23-2019 21:53   Packages/examples/PythonProjectInit/python_package.py
      195  02-23-2019 21:53   Packages/examples/PythonProjectInit/package-metadata.json
      315  02-23-2019 21:53   Packages/examples/PythonProjectInit/.gitignore
      129  02-23-2019 21:53   Packages/examples/EchoCommand/echo.py
      522  02-23-2019 21:53   Packages/examples/EchoCommand/package.json
---------                     -------
    28856                     18 files

Not only does this install every package, but all of them will be broken because Sublime only loads plugin files from the top level of the package. Plugins are only loaded from the top level, but other resources are picked up from everywhere. So for example the menu files will be picked up, but their commands are missing, so anything they specify will be disabled, etc.

To pull this off, you need to have one package per github repository, OR you need to specify in the repository file direct links to the sublime-package files (which you have to create yourself) so that Package Control can download them directly.

1 Like