Exemple #1
0
def init():
    """Initialize a snapcraft project."""
    snapcraft_yaml_path = lifecycle.init()
    echo.info("Created {}.".format(snapcraft_yaml_path))
    echo.wrapped(
        "Go to https://docs.snapcraft.io/the-snapcraft-format/8337 for more "
        "information about the snapcraft.yaml format.")
Exemple #2
0
 def _create_classic_confined_snapcraft_yaml(self):
     snapcraft_yaml_path = lifecycle.init()
     # convert snapcraft.yaml into a classic confined snap
     with fileinput.FileInput(snapcraft_yaml_path, inplace=True) as f:
         for line in f:
             print(line.replace('confinement: devmode',
                                'confinement: classic'),
                   end='')
Exemple #3
0
 def _create_classic_confined_snapcraft_yaml(self):
     snapcraft_yaml_path = lifecycle.init()
     # convert snapcraft.yaml into a classic confined snap
     with fileinput.FileInput(snapcraft_yaml_path, inplace=True) as f:
         for line in f:
             print(line.replace('confinement: devmode',
                                'confinement: classic'),
                   end='')
Exemple #4
0
def init():
    """Initialize a snapcraft project."""
    try:
        snapcraft_yaml_path = lifecycle.init()
    except errors.SnapcraftEnvironmentError as e:
        echo.error(e)
        sys.exit(1)
    echo.info('Created {}.'.format(snapcraft_yaml_path))
    echo.info('Edit the file to your liking or run `snapcraft` to get started')
Exemple #5
0
    def test_core_setup_skipped_if_not_classic(self):
        lifecycle.init()
        lifecycle.execute('pull', self.project_options)

        self.assertThat(self.witness_path, Not(FileExists()))
Exemple #6
0
def init():
    """Initialize a snapcraft project."""
    snapcraft_yaml_path = lifecycle.init()
    echo.info("Created {}.".format(snapcraft_yaml_path))
    echo.info("Edit the file to your liking or run `snapcraft` to get started")
Exemple #7
0
def init():
    """Initialize a snapcraft project."""
    snapcraft_yaml_path = lifecycle.init()
    echo.info('Created {}.'.format(snapcraft_yaml_path))
    echo.info(
        'Edit the file to your liking or run `snapcraft` to get started')
Exemple #8
0
    def test_core_setup_skipped_if_not_classic(self):
        lifecycle.init()
        lifecycle.execute('pull', self.project_options)

        self.assertThat(self.witness_path, Not(FileExists()))