Open DimuDesigns opened 5 years ago
@grant could you please advise on how the .claspignore
file should be located?
Current code does not give a clear idea of the intended process:
export const DOTFILE = {
/**
* Reads DOT.IGNORE.PATH to get a glob pattern of ignored paths.
* @return {Promise<string[]>} A list of file glob patterns
*/
IGNORE: () => {
// TODO: there seems to be a logic error in how `.claspignore` is resolved
const projectPath = findUp.sync(DOT.PROJECT.PATH);
const ignoreDirectory = path.join(projectPath ? path.dirname(projectPath) : DOT.PROJECT.DIR);
return new Promise<string[]>((resolve, reject) => {
if (
fs.existsSync(ignoreDirectory) // TODO: is ignoreDirectory really needed?
&& fs.existsSync(DOT.IGNORE.PATH)
) {
const buffer = stripBom(fs.readFileSync(DOT.IGNORE.PATH, { encoding: 'utf8' }));
resolve(splitLines(buffer).filter((name: string) => name));
} else {
resolve(['**/**', '!appsscript.json', '!*.js', '!*.ts']);
}
});
},
Unless I am missing something, it can be summarized as "look for .claspignore in CWD. If not present, use built-in default"
Should be next to the .clasp.json
Feature Request - Commands to streamline management of multiple push targets.
Describe the solution you'd like There have been a few similar proposals (#349 is one of them). I'd categorize this as a "nice-to-have", where we could have options to store, track and switch between multiple push targets (ie.
scriptId
s) via a switch/branching mechanism similar to howgit branch
functions. Likely requires a number of new commands. Something along the lines of:clasp target [TARGET-NAME] [SCRIPT-ID]
push
targetclasp target switch [TARGET-NAME]
clasp target list
clasp target delete [TARGET-NAME]
clasp target
And
.clasp.json
may have the following configuration:Describe alternatives you've considered Currently, we can leverage the
clasp settings
command to set thescriptId
key in.clasp.json
. But there is no history of prior push targets. Ideally, push targets (ie.scriptId
s) would be stored inclasp.json
as previously proposed in #349.