LoginSignup
2
1

More than 3 years have passed since last update.

clasp で rootDirを独自に設定している時の.claspignore

Last updated at Posted at 2020-03-07

問題になっていたこと

.clasp.json
{
  "scriptId": "<SCRIPT_ID>",
  "rootDir": "dist"
}

のように設定しつつ

.claspignore
**/*
!dist/**

と設定している状態で clasp push を実行すると、以下のエラー

  code: 400,
  errors: [
    {
      message: 'Project contents must include a manifest file named appsscript.',
      domain: 'global',
      reason: 'badRequest'
    }
  ]

この時のファイルの状態は

.claspignore
.clasp.json
src/
  hoge.js
dist/
  appsscript.json
  hoge.gs

原因

clasp status を実行すると

Not ignored files:

Ignored files:
└─ dist/appsscript.json
└─ dist/hoge.gs

と出力された。

.claspignore のファイルパスは、 .clasp.json で変更された rootDir に影響される模様。
すなわち、 .claspignore で指定するパスは、 rootDir で指定されたパスを起点に記述する必要が有る。

解決方法

.claspignore
!appsscript.json
!*.gs

と指定すれば、 clasp push の対象となった。

2
1
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
1