LoginSignup
2
2

More than 5 years have passed since last update.

Atomでパッケージを作ってみた その4

Posted at

Project以下に存在するファイルを取得するためのAPIの覚え書き。
実装していてハマった。

    #Projectのディレクトリを取得
    dirs = atom.project.getDirectories()
    #対象のディレクトリ以下を取得
    for dir in dirs
      #ディレクトリ以下のディレクトリやファイルを取得
      for entry in dir.getEntriesSync()
        if entry.isFile()
          console.log "F:" + entry.getPath()
        else if entry.isDirectory()
          console.log "D:" + entry.getPath()

これによって、再帰的にディレクトリ階層を辿れそうだ。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2