-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds support for rootDir in .clasp.json #25
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
I signed it again! |
CLAs look good, thanks! |
Great, I'll look at this later this week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good, just some formatting issues and question about formattedName
.
index.js
Outdated
@@ -482,10 +483,12 @@ program | |||
let nonIgnoredFilePaths = []; | |||
let files = filePaths.map((name, i) => { | |||
let nameWithoutExt = name.slice(0, -path.extname(name).length); | |||
// Formats rootDir/appsscript.json to appsscript.json. Preserves subdirectory names in rootDir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please wrap the comment.
index.js
Outdated
@@ -482,10 +483,12 @@ program | |||
let nonIgnoredFilePaths = []; | |||
let files = filePaths.map((name, i) => { | |||
let nameWithoutExt = name.slice(0, -path.extname(name).length); | |||
// Formats rootDir/appsscript.json to appsscript.json. Preserves subdirectory names in rootDir | |||
let formattedName = rootDir ? formattedName.slice(rootDir.length + 1, formattedName.length) : nameWithoutExt; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please wrap this long line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you declare formattedName
and use it in the same statement? Do you mean nameWithoutExt
? Maybe I'm missing something.
index.js
Outdated
if (err) return logError(err, ERROR.FS_FILE_WRITE); | ||
}); | ||
console.log(`└─ ${filePath}`); | ||
console.log(`└─ ${rootDir ? truePath : filePath}`); // Log only filename if pulling to root (Code.gs vs ./Code.gs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please wrap.
index.js
Outdated
@@ -444,10 +445,10 @@ program | |||
.command('pull') | |||
.description('Fetch a remote project') | |||
.action(() => { | |||
getProjectSettings().then((scriptId) => { | |||
getProjectSettings().then(({scriptId, rootDir}) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add spaces when destructuring:
getProjectSettings().then(({ scriptId, rootDir }) => {
Thanks for the feedback @grant - addressed your comments in the latest commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
closes #22
Solves for users who deploy from a non-root directory (ex.
build
) by adding support for arootDir
property in the project config file. This directory will be used in thepush
andpull
commands. Defaults to the root directory when the property does not exist.