HEX
Server: nginx/1.18.0
System: Linux mail.dakarash.co.id 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User: www-data (33)
PHP: 8.1.2-1ubuntu2.23
Disabled: NONE
Upload Files
File: //snap/tree/current/snap/snapcraft.yaml
%YAML 1.1
---
# Snapcraft Recipe for The Tree Command for Linux
# ------------------------------
# This file is in the YAML data serialization format:
# http://yaml.org
# For the spec. of writing this file refer the following documentation:
# * The snapcraft format
#   https://docs.snapcraft.io/the-snapcraft-format/8337
# * Snap Documentation
#   https://docs.snapcraft.io
# * Topics under the doc category in the Snapcraft Forum
#   https://forum.snapcraft.io/c/doc
# For support refer to the snapcraft section in the Snapcraft Forum:
# https://forum.snapcraft.io/c/snapcraft
name: tree
title: The Tree Command for Linux
summary: A directory listing command that produces a depth indented listing of files
description: |
  Tree is a recursive directory listing command that produces a depth indented listing of files, which is colorized ala dircolors if the LS_COLORS environment variable is set and output is to tty. Tree has been ported and reported to work under the following operating systems: Linux, FreeBSD, OS X, Solaris, HP/UX, Cygwin, HP Nonstop and OS/2.

  Note that if you just removed tree from APT distribution you will have to run the following command to regenerate GNU Bash's command search hash so that it will fall back to the command provided by the snap:

      hash -r

  simply logout and re-login the user session will work.

  This snap is maintained by ๆž—ๅšไป(Buo-ren Lin), and is not endorsed or officially maintained by the upstream developers.

# The license of this application, in SPDX format
# NOTE: Currently only supports SPDX 2.1 license expressions, as described in Appendix IV of
# https://spdx.org/spdx-specification-21-web-version
# Supported expressions:
# https://github.com/snapcore/snapd/blob/HEAD/spdx/licenses.go
license: GPL-2.0

# Version string just for humans, typically '1.2+git' or '1.3.2'
# The wrapping single quotes are often required to avoid the version string
# being accidentally interpreted as a YAML non-string(like '1', '1.2').
# http://yaml.org/type
# https://arp242.net/weblog/yaml_probably_not_so_great_after_all.html#surprising-behaviour
# NOTE: This key is mutual exclusive with the `adopt-info` key
#version: determined-by-adopt-info

# Extract metadata from the main snap part
# https://forum.snapcraft.io/t/extracting-information-from-sources-in-snapcraft-parts/4642
adopt-info: main

# Base runtime
# The common runtime for the snap to run on, or `bare` for static linked applications
base: core22

# Security confinement
# Use `devmode` to getting started
# Flip to `strict` once you have the right plugs and slots,
# or `classic` once you determine that strict confinement is not currently possible
confinement: strict

# Snap Grade
# Use `devel` to getting started
# Flip to `stable` once you determine that the snap is matured, only `stable` grade
# snaps can be promoted to `candidate` and `stable` channels
grade: stable

# Run `snapcraft help sources` for supported keywords on pulling a part's source ingredients
# Run `snapcraft plugins` for supported build helper plugins
# Run `snapcraft help plugins` for supported keywords on building a part
# For `override-*` scriptlets used to modify behavior of certain part's lifecycle phase, check out:
# https://docs.snapcraft.io/scriptlets/4892
parts:
  # Launcher programs to fix problems at runtime
  launchers:
    source: snap/local/launchers
    plugin: dump
    organize:
      '*': bin/
    stage:
    - -bin/README.*

  # Launcher for fixing the Glibc locales
  # https://forum.snapcraft.io/t/the-locales-launch-launcher-fix-glibc-locales-in-the-snap-runtime/10296
  locales-launch:
    source: https://github.com/brlin-tw/locales-launch.git
    source-tag: v1.0.0
    plugin: dump
    stage-packages:
      # For localedef(1)
      - libc-bin

      # For locale data used by localedef(1)
      - locales
    stage:
      - bin/locales-launch
      - etc/locale.alias
      - usr/bin/localedef
      - usr/share/doc/locales
      - usr/share/i18n
      - usr/share/locale

  main:
    source: https://gitlab.com/OldManProgrammer/unix-tree.git
    build-packages:
      - gcc

      # selective-checkout dependencies
      - curl
      - jq
      - sed
      - git
    override-pull: |
      set -o nounset

      if ! craftctl default; then
          printf \
            'Error: Unable to run the default action of this step.\n' \
            1>&2
            exit 2
      fi

      if ! "${CRAFT_PROJECT_DIR}/snap/local/scriptlets/selective-checkout" \
          --append-packaging-revision; then
          printf \
              'Error: Unable to run the selective-checkout scriptlet.\n' \
              1>&2
              exit 2
      fi
    plugin: make
    override-build: |
      set -o nounset

      printf 'Info: Patching the version string...\n'
      sed_opts=(
        --in-place
        --regexp-extended
        # NOTE: The `--file` option must come after `--regexp-extended`
        --file="${CRAFT_PROJECT_DIR}/snap/local/patching/customizations-specific-to-the-snap-distribution.sed"
      )
      if ! sed "${sed_opts[@]}" tree.c; then
          printf 'Error: Unable to patch the version string.\n' 1>&2
          exit 2
      fi

      # The upstream makefile places the tree binary directly under DESTDIR...
      # workaround it by implement the build step completely
      printf 'Info: Building the application from source...\n'
      make_opts=(
          --jobs="${CRAFT_PARALLEL_BUILD_COUNT}"
      )
      if ! make "${make_opts[@]}"; then
          printf 'Error: Unable to build the application from source.\n' 1>&2
          exit 2
      fi

      printf 'Info: Installing the application to the install tree of the "main" part...\n'
      make_params=(
          PREFIX="${CRAFT_PART_INSTALL}"
      )
      if ! make "${make_params[@]}" install; then
          printf 'Error: Unable to install the application to the install tree of the "main" part.\n' 1>&2
          exit 2
      fi

# Apps that are exposed by the snap package
# If the _app_name_ is identical with the _snap_name_ it can be directly run
# with `_snap_name_` or `snap run _snap_name_` commands, otherwise it can only be run
# via `_snap_name_._app_name_` or `snap run _snap_name_._app_name_`
apps:
  tree:
    # An *relative path* to an executable file root from the `prime` directory to be executed, and its command-line arguments
    # NOTE: The right angle bracket at the beginning of the value of the `command` keyword starts a YAML folded style block scalar, refer the following spec document for more info: http://yaml.org/spec/1.2/spec.html#id2796251
    command: bin/tree

    # The commands that are run, in order, before running the one specified by the `command` key
    command-chain:
    - bin/locales-launch
    - bin/tree-launch

# Refer the following documentation for asserting interface plugs and slots in a security confined snap:
# Interface management - doc - snapcraft.io
# https://docs.snapcraft.io/interface-management/6154
# Supported interfaces - doc - snapcraft.io
# https://docs.snapcraft.io/supported-interfaces/7744
# Non-A/C: Non-autoconnect interface
plugs:
  # Storage access
  home:
  removable-media: # Non-A/C