-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGS_CrunchGS.gs
More file actions
44 lines (40 loc) · 1.43 KB
/
Copy pathGS_CrunchGS.gs
File metadata and controls
44 lines (40 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
function crunchGS_Data(objOfData, srcFileData) {//Branching control for which options to run
var tempStr;
if (objOfData.idRemoveLogger) {//If the user checked the box to remove Logger log lines
tempStr = dletLoggerLines(srcFileData);
if (!tempStr) {return "//Nothing Left";}
srcFileData = tempStr;
}
if (objOfData.idDletLead) {
srcFileData = dletBegSpaces(srcFileData);
}
//Logger.log('objOfData.idDletTrail: ' + objOfData.idDletTrail)
if (objOfData.idDletTrail) {
srcFileData = removeTrailingSpaces(srcFileData);
}
//Logger.log('objOfData.idRemoveComments: ' + objOfData.idRemoveComments);
if (objOfData.idRemoveComments) {
tempStr = fncCommentsDlet(srcFileData);
if (!tempStr) {
return "//Nothing Left";
}
srcFileData = tempStr;
}
if (objOfData.idLinesBetweenGS) {
tempStr = fncRemoveBlankLines(srcFileData);
if (!tempStr || tempStr === " ") {
return "//Nothing Left";
}
srcFileData = tempStr;
}
//Logger.log('removeLinesGS: ' + removeLinesGS);
if (objOfData.idDletSpaces) {
srcFileData = removeSpaces(srcFileData);
}
//if (objOfData.idConsolidateEnd) {srcFileData = crunchEndBlocks(srcFileData);};
//var d_date = new Date().toString().slice(0,10);
//var doc = DriveApp.createFile(d_date, srcFileData)
//Logger.log('srcFileData comments deleted: ' + srcFileData);
if (!srcFileData) {srcFileData = "//Nothing Left"};
return srcFileData;
};