-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added hiding of xcode library schemes as a third feature.
- Loading branch information
Kevin Brown
committed
Jan 25, 2017
1 parent
a050d2e
commit 5fab200
Showing
10 changed files
with
122 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const chalk = require('chalk'); | ||
const path = require('path'); | ||
|
||
const utilities = require('./utilities'); | ||
|
||
function updateFile (file, filePath) { | ||
let changed = false; | ||
|
||
if (file.SchemeUserState) { | ||
for (const key of Object.keys(file.SchemeUserState)) { | ||
if (key.endsWith('.xcscheme')) { | ||
const scheme = file.SchemeUserState[key]; | ||
|
||
if (!scheme.hasOwnProperty('isShown') || scheme.isShown) { | ||
scheme.isShown = false; | ||
changed = true; | ||
|
||
console.log(chalk.gray(` ${chalk.green('✔')} [hide-library-schemes]: ${path.dirname(path.relative(process.cwd(), filePath))} ${chalk.green('hidden')}`)); | ||
} else { | ||
console.log(chalk.gray(` - [hide-library-schemes]: ${path.dirname(path.relative(process.cwd(), filePath))} skipped`)); | ||
} | ||
} | ||
} | ||
} | ||
|
||
return changed; | ||
} | ||
|
||
module.exports = function findAndFix () { | ||
// Find all of the pbxproj files we care about. | ||
const userSpecificPattern = './node_modules/**/*.xcodeproj/xcuserdata/*.xcuserdatad/xcschemes/xcschememanagement.plist'; | ||
|
||
console.log(chalk.gray('Hiding schemes from node_modules xcode projects.')); | ||
|
||
utilities.updatePlistsMatchingGlob(userSpecificPattern, (err, file, filePath) => { | ||
return updateFile(file, filePath); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
fixLibraries: require('./fix-libraries'), | ||
fixScript: require('./fix-script'), | ||
hideLibrarySchemes: require('./hide-library-schemes'), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters