I'm not able to expose a script from within a snap












1















So I'm trying to learn how to create a snap package, and are using a simple python script as a base (https://gitlab.xirion.net/vroest/dice-roller/tree/master).

I have gotten snapcraft to work properly, and have installed the snap package but I'm not able to get the script to run from my terminal.



snap install --devmode --dangerous cli-diceroller_1.9_amd64.snap


I have followed the guide here: https://tutorials.ubuntu.com/tutorial/create-your-first-snap#3

Here is the yaml-file:



name: cli-diceroller
base: core18
version: '1.9'
summary: A python dice rolling application using standard dice notation
description: |
Syntax is: roll <dice_code>
Example: roll 2d8 + 6 + d8
Instead of a dice code you can also put "stats" or "dir" for a stats roll or direction roll respectively.

grade: devel
confinement: devmode

apps:
roll:
command: bin/roll

parts:
diceroller:
plugin: python
python-version: python3
source: https://gitlab.xirion.net/vroest/dice-roller.git


when i run this command, the script works as normal



/snap/cli-diceroller/x1/bin/roll


what am I missing?










share|improve this question







New contributor




Sikander Lhote is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    1















    So I'm trying to learn how to create a snap package, and are using a simple python script as a base (https://gitlab.xirion.net/vroest/dice-roller/tree/master).

    I have gotten snapcraft to work properly, and have installed the snap package but I'm not able to get the script to run from my terminal.



    snap install --devmode --dangerous cli-diceroller_1.9_amd64.snap


    I have followed the guide here: https://tutorials.ubuntu.com/tutorial/create-your-first-snap#3

    Here is the yaml-file:



    name: cli-diceroller
    base: core18
    version: '1.9'
    summary: A python dice rolling application using standard dice notation
    description: |
    Syntax is: roll <dice_code>
    Example: roll 2d8 + 6 + d8
    Instead of a dice code you can also put "stats" or "dir" for a stats roll or direction roll respectively.

    grade: devel
    confinement: devmode

    apps:
    roll:
    command: bin/roll

    parts:
    diceroller:
    plugin: python
    python-version: python3
    source: https://gitlab.xirion.net/vroest/dice-roller.git


    when i run this command, the script works as normal



    /snap/cli-diceroller/x1/bin/roll


    what am I missing?










    share|improve this question







    New contributor




    Sikander Lhote is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      1












      1








      1








      So I'm trying to learn how to create a snap package, and are using a simple python script as a base (https://gitlab.xirion.net/vroest/dice-roller/tree/master).

      I have gotten snapcraft to work properly, and have installed the snap package but I'm not able to get the script to run from my terminal.



      snap install --devmode --dangerous cli-diceroller_1.9_amd64.snap


      I have followed the guide here: https://tutorials.ubuntu.com/tutorial/create-your-first-snap#3

      Here is the yaml-file:



      name: cli-diceroller
      base: core18
      version: '1.9'
      summary: A python dice rolling application using standard dice notation
      description: |
      Syntax is: roll <dice_code>
      Example: roll 2d8 + 6 + d8
      Instead of a dice code you can also put "stats" or "dir" for a stats roll or direction roll respectively.

      grade: devel
      confinement: devmode

      apps:
      roll:
      command: bin/roll

      parts:
      diceroller:
      plugin: python
      python-version: python3
      source: https://gitlab.xirion.net/vroest/dice-roller.git


      when i run this command, the script works as normal



      /snap/cli-diceroller/x1/bin/roll


      what am I missing?










      share|improve this question







      New contributor




      Sikander Lhote is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      So I'm trying to learn how to create a snap package, and are using a simple python script as a base (https://gitlab.xirion.net/vroest/dice-roller/tree/master).

      I have gotten snapcraft to work properly, and have installed the snap package but I'm not able to get the script to run from my terminal.



      snap install --devmode --dangerous cli-diceroller_1.9_amd64.snap


      I have followed the guide here: https://tutorials.ubuntu.com/tutorial/create-your-first-snap#3

      Here is the yaml-file:



      name: cli-diceroller
      base: core18
      version: '1.9'
      summary: A python dice rolling application using standard dice notation
      description: |
      Syntax is: roll <dice_code>
      Example: roll 2d8 + 6 + d8
      Instead of a dice code you can also put "stats" or "dir" for a stats roll or direction roll respectively.

      grade: devel
      confinement: devmode

      apps:
      roll:
      command: bin/roll

      parts:
      diceroller:
      plugin: python
      python-version: python3
      source: https://gitlab.xirion.net/vroest/dice-roller.git


      when i run this command, the script works as normal



      /snap/cli-diceroller/x1/bin/roll


      what am I missing?







      snap






      share|improve this question







      New contributor




      Sikander Lhote is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      Sikander Lhote is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      Sikander Lhote is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked yesterday









      Sikander LhoteSikander Lhote

      82




      82




      New contributor




      Sikander Lhote is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Sikander Lhote is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Sikander Lhote is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          0














          When the app name (roll in this case) is different from the snap name (cli-diceroller) the binary is installed as <snap-name>.<app-name> to prevent namespace clashes:



          $ cli-diceroller.roll
          Syntax is: roll <dice_code>
          Example: roll 2d8 + 6 + d8
          Instead of a dice code you can also put "stats" or "dir" for a stats roll or direction roll respectively


          If you rename your part to cli-diceroller, the executable will be available under that name. (This is documented on the snapcraft.yaml reference.)






          share|improve this answer








          New contributor




          Claudio Matsuoka is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





















          • ahh. i see. i missed that since it's not mentioned in the tutorials i found. i'll make sure to check the reference next time i don't understand something!

            – Sikander Lhote
            18 hours ago











          • I think that executable naming rule could be better explained, I'll report that to the documentation maintainers :)

            – Claudio Matsuoka
            15 hours ago











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          Sikander Lhote is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1115834%2fim-not-able-to-expose-a-script-from-within-a-snap%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          When the app name (roll in this case) is different from the snap name (cli-diceroller) the binary is installed as <snap-name>.<app-name> to prevent namespace clashes:



          $ cli-diceroller.roll
          Syntax is: roll <dice_code>
          Example: roll 2d8 + 6 + d8
          Instead of a dice code you can also put "stats" or "dir" for a stats roll or direction roll respectively


          If you rename your part to cli-diceroller, the executable will be available under that name. (This is documented on the snapcraft.yaml reference.)






          share|improve this answer








          New contributor




          Claudio Matsuoka is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





















          • ahh. i see. i missed that since it's not mentioned in the tutorials i found. i'll make sure to check the reference next time i don't understand something!

            – Sikander Lhote
            18 hours ago











          • I think that executable naming rule could be better explained, I'll report that to the documentation maintainers :)

            – Claudio Matsuoka
            15 hours ago
















          0














          When the app name (roll in this case) is different from the snap name (cli-diceroller) the binary is installed as <snap-name>.<app-name> to prevent namespace clashes:



          $ cli-diceroller.roll
          Syntax is: roll <dice_code>
          Example: roll 2d8 + 6 + d8
          Instead of a dice code you can also put "stats" or "dir" for a stats roll or direction roll respectively


          If you rename your part to cli-diceroller, the executable will be available under that name. (This is documented on the snapcraft.yaml reference.)






          share|improve this answer








          New contributor




          Claudio Matsuoka is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





















          • ahh. i see. i missed that since it's not mentioned in the tutorials i found. i'll make sure to check the reference next time i don't understand something!

            – Sikander Lhote
            18 hours ago











          • I think that executable naming rule could be better explained, I'll report that to the documentation maintainers :)

            – Claudio Matsuoka
            15 hours ago














          0












          0








          0







          When the app name (roll in this case) is different from the snap name (cli-diceroller) the binary is installed as <snap-name>.<app-name> to prevent namespace clashes:



          $ cli-diceroller.roll
          Syntax is: roll <dice_code>
          Example: roll 2d8 + 6 + d8
          Instead of a dice code you can also put "stats" or "dir" for a stats roll or direction roll respectively


          If you rename your part to cli-diceroller, the executable will be available under that name. (This is documented on the snapcraft.yaml reference.)






          share|improve this answer








          New contributor




          Claudio Matsuoka is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.










          When the app name (roll in this case) is different from the snap name (cli-diceroller) the binary is installed as <snap-name>.<app-name> to prevent namespace clashes:



          $ cli-diceroller.roll
          Syntax is: roll <dice_code>
          Example: roll 2d8 + 6 + d8
          Instead of a dice code you can also put "stats" or "dir" for a stats roll or direction roll respectively


          If you rename your part to cli-diceroller, the executable will be available under that name. (This is documented on the snapcraft.yaml reference.)







          share|improve this answer








          New contributor




          Claudio Matsuoka is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          share|improve this answer



          share|improve this answer






          New contributor




          Claudio Matsuoka is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          answered 20 hours ago









          Claudio MatsuokaClaudio Matsuoka

          161




          161




          New contributor




          Claudio Matsuoka is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





          New contributor





          Claudio Matsuoka is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          Claudio Matsuoka is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.













          • ahh. i see. i missed that since it's not mentioned in the tutorials i found. i'll make sure to check the reference next time i don't understand something!

            – Sikander Lhote
            18 hours ago











          • I think that executable naming rule could be better explained, I'll report that to the documentation maintainers :)

            – Claudio Matsuoka
            15 hours ago



















          • ahh. i see. i missed that since it's not mentioned in the tutorials i found. i'll make sure to check the reference next time i don't understand something!

            – Sikander Lhote
            18 hours ago











          • I think that executable naming rule could be better explained, I'll report that to the documentation maintainers :)

            – Claudio Matsuoka
            15 hours ago

















          ahh. i see. i missed that since it's not mentioned in the tutorials i found. i'll make sure to check the reference next time i don't understand something!

          – Sikander Lhote
          18 hours ago





          ahh. i see. i missed that since it's not mentioned in the tutorials i found. i'll make sure to check the reference next time i don't understand something!

          – Sikander Lhote
          18 hours ago













          I think that executable naming rule could be better explained, I'll report that to the documentation maintainers :)

          – Claudio Matsuoka
          15 hours ago





          I think that executable naming rule could be better explained, I'll report that to the documentation maintainers :)

          – Claudio Matsuoka
          15 hours ago










          Sikander Lhote is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Sikander Lhote is a new contributor. Be nice, and check out our Code of Conduct.













          Sikander Lhote is a new contributor. Be nice, and check out our Code of Conduct.












          Sikander Lhote is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1115834%2fim-not-able-to-expose-a-script-from-within-a-snap%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          數位音樂下載

          When can things happen in Etherscan, such as the picture below?

          格利澤436b